190 likes | 306 Views
What is this course about?. A chance to “improve” your C/C++ …. Problem Insight and Execution. Preparation for the ACM competition. 3 team members, more or less 2 problems/week, more or less class web page at www.cs.hmc.edu/ACM submission through /cs/ACM/acmSubmit.
E N D
What is this course about? A chance to “improve” your C/C++ … Problem Insight and Execution ... Preparation for the ACM competition ... • 3 team members, more or less • 2 problems/week, more or less • class web page at www.cs.hmc.edu/ACM • submission through /cs/ACM/acmSubmit Organization:
Intro Problem The “split pea” problem (also see the webpage) file: pea.cc Root configuration each pea splits & jumps peas bounce off the wall & fall into oblivion
Welcome to Programming Practicum Waiting for the snow enveloping you on Route 5 N to melt “Putting the C into CS” University of Waterloo Engineering dept. On the 405, in traffic, being chased by police (and TV) helicopters. You aren’t here writing clinic reports Lecture rebooting turing coding chunky strings reading requests liaison phone call Mailing something at the Claremont Post Office Pitzer
What is this course about? A chance to “improve” your C/C++ … Problem Insight and Execution ... Preparation for the ACM competition ...
Organization Solving problems in teams • 3 team members, more or less • 2 problems/week, more or less • class web page at www.cs.hmc.edu/ACM • submission through /cs/ACM/acmSubmit
Intro Problem The “split pea” problem (also see the webpage) file: pea.cc Root configuration each pea splits & jumps
What, no contest!? We will have a mock contest at the end of the term. • tentatively Tuesday, April 17 • four hours (from 4:15 to 8:15) • contest conditions will apply • dinner will be provided... This will be the final class session except we’ll stretch team size to 1-4 people... - only written material can be used - only one machine per team - (we will have a chair for each team member) - minimal feeback from submissions - time penalties for incorrect submssions
Grading Graded or P/F: grade based on solving success • 1.75 problems/week => A • 1.25 problems/week => B • 0.75 problems/week => C • 0.25 problems/week => D Or winning the contest... Coding Guidelines • share coding tasks within teams, not among them • discussion of algorithms always OK • start from scratch each time!
Course Outline Jan 16 continental fare Jan 23 slim jims Jan 30 Hostess Feb 6 goldfish Feb 13 candy hearts imprinted with C++ library calls Feb 20 Drake’s coffee cake Feb 27 baklava Mar 6 Apple Jacks -- spring break --
Intro Problem The “split pea” problem (also see the webpage) The number of configurations the # of cups to follow the # of peas in each cup # of cups # of peas ... 2 5 1 3 0 3 0 3 7 0 7 Input: stdin input 3 2 Output: The # of transitions from a root configuration to the given one. stdout output shaken or stirred?
Intro Problem The “NAND” problem (also see the webpage) file to create: nand.cc NAND Problem x y x|y 0 0 1 0 1 1 1 0 1 1 1 0 NAND gates can specify any logical function. Consider two N-bit binary numbers, A and B. There is a logical function mapping A and B to the overflow bit of their sum. A = 10 B = 11 A+B = 101 the overflow bit -- it’s a function of the input bits
Intro Problem The “NAND” problem (also see the webpage) file to create: nand.cc Problem: NAND gates can specify any logical function. Consider two N-bit binary numbers, A and B. There is a logical function mapping A and B to the overflow bit of their sum. 1 10 10 20 Input: Lines with two integers > 0. Same lines, plus the max # of steps to get to 1 in the given range. 1 10 20 10 20 21 Output:
Topics Outline Sep 5 Basic coding strategies (ACM style) Sep 12 Dynamic programming ’n’ data structures Sep 19 Search algorithms ’n’ data structures Sep 26 Numerical algorithms: DEs, equations Oct 3 I/O in C/C++ = building parsers quickly Oct 10 Built-in string functions: strcmp, strtok, and the like Oct 24 Built-in math functions: atan vs. atan2, precision issues, ... Oct 31 Geometric algorithms ‘n’ data structures Nov 7 Contest strategies, logistics, preparing materials
What is this course about? A chance to “improve” your C/C++ … prog practice Preparation for the ACM competition ... Problem Insight and Execution ... 2 1 Anxiety! Get into the minds of the judges
Get into the minds of the judges Key Skill #1: mindreading
Key Skill #2: anxiety Anxiety!