Page 1 of 1

11041 - Quarter-Finals with Brazil!? No!!!

Posted: Sat Jun 10, 2006 6:15 pm
by sclo
Any idea on how to solve this problem?

Posted: Sat Jun 10, 2006 7:29 pm
by little joey
It's not easy to give hints without spoiling the problem.
Use psychology: if you were playing in a knock-out competition, what kind of teams would you like to meet in which stage of the competition? The strongest teams first? Or maybe the weaker, in the hope another team knocks out the stronger teams?
Run a few simulations with a small number of teams, either by hand or write a BF program.
Getting the output right is the hardest part of the problem, IMO.

Posted: Sun Jun 11, 2006 6:06 am
by sclo
I can see the pattern for n=3, but for n=4, that is 16, it becomes too messy, I'll need to think about what happens more carefully. Good hint though.

Now, I finally got AC, after I fix my tie breaking rules.

Posted: Wed Jun 14, 2006 5:11 pm
by Krzysztof Duleba
Nice problem!

My code seemed to be ok right away - it passed a set of 10^7 test cases, but still was getting WA. It took me 10 hours to find the error: using

Code: Select all

me -= 'A';
instead of

Code: Select all

if(isupper(me))me -= 'A';
else me = (me - 'a') + 26;

Posted: Fri Aug 25, 2006 7:27 am
by shanto86
well... can any one ensure me this greedy strategy?

we will try to select weak teams in my group. now in case of tie for weak, we will select such a team so that our answer becomes lex smallest.

is my approach right?

Posted: Fri Aug 25, 2006 8:23 am
by Krzysztof Duleba
Yes, that's correct (the proof is not dificult, too), except that the second part is not trivial.

Posted: Fri Aug 25, 2006 12:20 pm
by shanto86
thanks for ur reply.

Posted: Sat Aug 26, 2006 6:07 am
by shanto86
some test case plz, getting WA

Posted: Sat Aug 26, 2006 6:12 am
by shanto86
AC

Posted: Sun May 27, 2007 8:52 am
by annhy
sclo wrote:Now, I finally got AC, after I fix my tie breaking rules.
AC.. :D

This problem contains two parts.

The first part can be solve by the GREEDY strategy posted above.
And the second part is to rearrange the round tree to minimize the string.

I found that the second part is more difficult than the first part.
(It really needs a good tie breaking rule)

Re: 11041 - Quarter-Finals with Brazil!? No!!!

Posted: Mon Mar 01, 2010 7:46 pm
by kangbb
I first set s(our team) = 0, and sort the teams with smallest lex order.
But how can I rearrange the teams in second part? Can anyone give me some hints?
Thanks a lot !!