Hacker News new | ask | show | jobs
by nicknash 333 days ago
I wonder if you can clear up a memory of mine from IOI 2001. The first day results were delayed, and I seem to remember this is because a contestant encoded the search in one of the problems into a compile time c++ template metaprogram. On the second day, there was then also a compile time limit for solutions, from what I remember. Do you remember any more details of this?
3 comments

I think I know the culprit. The story I was told is that the person precomputed some of the results and submitted a huge source file (in tens of megabytes) of hard coded data. This probably led to subsequent amendment of the rules regarding source file sizes.

I'll report back once I find the persons involved.

Wasn't this for one of the questions on the second day? Where you had to submit a series of outputs, but these were trivial to generate once you cracked the problem.

I remember getting an "aha" moment, writing a program, and then submitting (scored 100% too!). Then, I met a guy who also cracked the problem and realized that he just needed to paste the test data into a spreadsheet, do some basic sorting there, and then paste the output into a text file; no coding necessary.

I felt pretty stupid afterwards.

I think you're referring to "double crypt" of the day 2 problem set. For this problem you submit the result/answer instead of the code, so it shouldn't trigger a compilation/source code limit.
His comment when I showed him this thread: "That was my ah-ha moment of recognizing the beauty of codegen"
That sounds very smart :D
But aren't the programs given access to the problem data _after_ the program has been compiled?
Yeah, but they didn't precompute the solution for that specific program data, they precomputed the solution for all possible ones, and then selected the correct one when the program data was provided.
Sure, but the input might be bounded/finite, or the operations needed similarly constrained (e.g. trigonometry operations). Then you can offload lots of the computation to the compilation, sometimes all of it.
There are plenty of opportunities to precompute _everything_ for a certain class of problems.
No, sorry. I vaguely remember compile time limits, but they were high enough (30 seconds, I think?) that I didn't bother worrying about them (at least, that's my memory).