One of the key ideas to keep in mind when learning from USA Computing
Olympiad problems is that time matters. A slow algorithm is not good
enough; keep thinking about the problem, trying to find a more
efficient way to solve it. Always time your solutions. Always try your
solutions on the official test cases — many times they will contain
a situation that you have not considered. Enjoy it when that happens.