SkyHawk's blog

By SkyHawk, 12 years ago, translation, In English

The second qualification round will be held today at 20:00 (Moscow time). You should be registered at TCO 2012 to participate in this round. Number of participant is limited to the first 2000 competitors. Programmers from both divisions will compete together.

Register, psrticipate, win! =)

Third qualification round will be held a week later, 14 april at the same time.

  • Vote: I like it
  • +27
  • Vote: I do not like it

»
12 years ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

Can someone please explain me the intution of Prob 500.I saw a solution of Yarin which is as follows:

Collections.sort(a);
while(a.size()>1)
{
a.set(0,Math.max(a.get(0),a.get(1))+hammerCost);
a.remove(1);
Collections.sort(a);
}

But I cannot figure out why this happens??Would be grateful if someone explains the reason....