Sorry, Just rechecked and it would return 82. Still trying a counterexample.
On Wed, May 2, 2018 at 11:13 PM, Juarez Paulino <[email protected]> wrote: > What about the following: > > 121 39 > 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 > 3 3 > > Maybe your code returns 81 instead of 82. > > I have almost the same algorithm, but in my code I've intially found out > (between steps 2 and 3) how many votes to "round up" a new language (let > it be *m*) and I've stopped in your third step when greedly adding *x* > votes to existing languages is worse than creating a new one (*x < m*). > > > On Wed, May 2, 2018 at 6:59 PM, Matej P <[email protected]> wrote: > >> My solution for the problem was marked as a correct one, but I somehow >> doubt that it is truly correct, since I was a bit careless. The pseudocode >> for my solution is the following: >> >> 1) Figure out how many more votes each of the ALREADY MENTIONED languages >> would need in order for it to be rounded up. >> 2) Sort those languages increasingly according to 1). >> 3) Satisfy the 1st language, satisfy the 2nd language ... (if possible). >> >> If there are any votes left: >> 4) Find out how many additional votes a language with 0 votes would need >> in order for it to be rounded up. >> 5) Create as many new rounded-up languages as possible. >> >> Clearly, this may lead to a suboptimal solution, but I cannot find an >> example where this would really happen. Unfortunately, I am also unable to >> prove that there aren't any such examples. >> >> Are you able to prove or disprove that? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Code Jam" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> To view this discussion on the web visit https://groups.google.com/d/ms >> gid/google-code/ef9dbb04-4e0e-4dbd-873a-a8edbf776e5d%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CANGQpYyCsrub08KH0bzCZ6WZ8kBo%2BMOZPr9Oy%3DqntFkT0XOLDg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
