masterchief164's blog

By masterchief164, history, 3 years ago, In English

1399C - Boats Competition
I've tried to solve the problem using both maps and unordered_maps The failed code and the accepted code.
The accepted code used maps and the failed code uses unordered_maps. But the funny thing is that when I run the code on my machine it gives the correct output while when I submit the code it fails. I know that maps sorts it's elements while unordered_maps don't. Moreover there is no need of sorting the elements as per the question as it requires simple brute force.
I've tried to run it on gcc 17 on my machine (hope it helps). Here is the output on my machine.

Full text and comments »

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