====== Weekly Contest for August 30, 2011 ====== ===== One-Time Setup ===== From your lab workstation, use these commands to get started... % mkdir pc2 % cp -p /homes/cs390cp/pc2/pc2v9.ini pc2 ===== Join the Contest ===== % cd pc2 % /homes/cs390cp/pc2/bin/pc2team & Log in using your individually assigned "teamX" account and password. You can work in the current window/directory, creating a subdirectory for each problem. ===== Problems ===== * A: [[contest_australian_voting_wrapup|Wrapping Up Australian Voting]] * B: [[contest_prelude_jolly_jumpers|Prelude to Jolly Jumpers]] * C: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110201&format=html|Jolly Jumpers]] * D: [[contest_prelude_contest_scoreboard|Prelude to Contest Scoreboard]] * E: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110207&format=html|Contest Scoreboard]] * F: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110202&format=html|Poker Hands]] If you've already solved one or more of these problems, try (1) solving again without referring to your old solution, and/or (2) using a different language (Java or C++). If you want to work on an additional problem from this chapter, let [[jtk@purdue.edu|me]] know. **Hints:** * A: The main steps during each "round" of the voting are to (1) compute the number of votes for top-ranked candidates (skipping candidates that have been eliminated), (2) find maximum and minimum number of votes received by each of the top-ranked candidates, and (3) if there is no one with a majority of the votes (and there is no tie), remove candidates with minimum number of votes. * B: Array.sort is your friend. * C: A single array to count each of the possible differences is all it takes. * D: Use this problem to get started on the next one. * E: The solution is not long, but requires a fair amount of bookkeeping. Using objects to represent teams is one way to manage the storage. * F: More tedious than anything. Good parsing practice.