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

Next revision
Previous revision
contest_2011-08-30 [2011/08/27 13:48] – created from previous week jtkorbcontest_2011-08-30 [2011/08/28 15:33] (current) jtkorb
Line 17: Line 17:
 ===== Problems ===== ===== Problems =====
  
-  * A: [[contest_2011-08-23_practice|Getting Started]] +  * A: [[contest_australian_voting_wrapup|Wrapping Up Australian Voting]] 
-  * B: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110101&format=html|The 3n+1 Problem]] +  * B: [[contest_prelude_jolly_jumpers|Prelude to Jolly Jumpers]] 
-  * C: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110102&format=html|Minesweeper]] +  * 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=110103&format=html|The Trip]] +  * D: [[contest_prelude_contest_scoreboard|Prelude to Contest Scoreboard]] 
-  * E: [[http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110108&format=html|Australian Voting]]+  * 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. 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: (1) Read carefully the part about echoing the input. (2) Is performance an issue?  Consider remembering what you've already computed.  (3) Do you handle the largest possible input? +  * 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: Make sure you handle the edge cases correctly+  * B: Array.sort is your friend
-  * C: 10.03 * 100 != 1003+  * C: A single array to count each of the possible differences is all it takes
-  * D: If the voting results in a tieprint the tied candidates in input order.+  * D: Use this problem to get started on the next one. 
 +  * E: The solution is not longbut 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.1314478104.txt.gz · Last modified: 2011/08/27 13:48 by jtkorb