Hey Eric, You are right except for the special case when only 2 parties are left, either because we have only 2 parties or because it is the last 2 people. In that case you must let out people 2 by 2 to keep a perfect tie in the assembly.
Le dim. 8 mai 2016 16:34, Eric Mordezki <e.morde...@gmail.com> a écrit : > Could I get some help as to why my algorithm couldn't solve this exercise? > > The problem was to figure a way to let people out without having a party > with +50% of the total amount of people, so my idea was to always let out > people from the party with the most people. That way the others would never > have the majority. > > As it said one could print any possible evacuation plan and people can > leave one by one, I figured we could always let people leave one by one > until there's only two people, because if only one left, the other party > would have majority, so the last step would always contain 2 people of > different parties. > > Where did I get it wrong? > > -- > 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 google-code+unsubscr...@googlegroups.com. > To post to this group, send email to google-code@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/4efb1178-42c8-410a-946a-3ae6cc787ad3%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 google-code+unsubscr...@googlegroups.com. To post to this group, send email to google-code@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CA%2B5pNgKVr0r%3Didd1ssXZH%2BcjnNrKa9UxwZpR5Y_jVsRAyvfBXg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.