User Tools

Site Tools


contest_2011-08-30

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
contest_2011-08-30 [2011/08/28 10:59] jtkorbcontest_2011-08-30 [2011/08/28 15:33] (current) jtkorb
Line 18: Line 18:
  
   * A: [[contest_australian_voting_wrapup|Wrapping Up Australian Voting]]   * A: [[contest_australian_voting_wrapup|Wrapping Up Australian Voting]]
-  * B: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110108&format=html|Australian Voting]] +  * B: [[contest_prelude_jolly_jumpers|Prelude to Jolly Jumpers]] 
-  * C: [[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: [[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: [[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=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. 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.
  
-**Notes:** +**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.
contest_2011-08-30.1314554342.txt.gz · Last modified: 2011/08/28 10:59 by jtkorb