← All posts
← →

just a stub, and 65 points!

A 65-point stub: how I won IOI gold without solving the problem

2002

On the second day of the 2002 International Olympiad in Informatics in Korea there was a problem called Bus Terminals. You had to place two terminals in a graph so that the longest route came out as short as possible.

I sat over it and just couldn’t come up with a correct solution. So I decided to write a stub: a program that doesn’t honestly solve the problem but gives the right answer on at least some tests. Even 10 or 20 points. Three problems at 20 each is already 60; that’s progress.

There is an even simpler trick: the examples from the problem statement are part of the tests too. Without thinking at all, you can write a program that recognises the example input and prints the answer from the statement. That’s 10 points on every problem, and with five problems it’s already 50.

My stub gave the right answer on both examples and, apparently, on something else as well. It scored 65 points. I was very proud of it.

Two of the easier problems I solved for 100. On stubs in the rest I picked up about 120 more. That came to around 320 in total, and the gold cut-off was around 300. So it looks like it was this very stub that won me the gold. How the whole trip went is a separate story.

What I took from it: a partial solution beats zero. If you can’t do it properly, make something that works at least a little; sometimes that is enough to get over the line.