A couple of days ago I was asked to answer the question "What is it like to be a problem writer for programming competitions?" at Quora web-site. My first idea of the answer had only one word, but then I've thought of a more detailed one, and then of a story I must include, hmm, and I should definitely mention this... Around the second page I realized that this is becoming more than an answer, and at the third one I decided to share this article with a qualified audience — that would be you.
So, what is it like to be a problem writer for programming competitions?
In one word (the one I've thought of at first), it's "awesome". In a bit more detail, "hard, sometimes unrewarding, but anyways fascinating job". In even more detail... First of all, inventing problems is more interesting than solving problems invented by other people — otherwise problems for tournaments and regular contests would be written by contest organizers only :-) The author is more important for the contest quality (and sometimes even for its existence) than any single participant, in fact, his importance is second only to the contest organizers. Whether I choose to participate in any particular contest and how many problems I solve, matters only to me, maybe to a couple of my fans. Yet an Unknown Language Round involving some crazy language or the first round of Marathon track in TCO affects hundreds of people.
Next, setting problems for a contest yields not only material remuneration (the rumor is, some people write problems without any fee), but also a set of positive emotions:
- the pride for your problems (and yourself) being chosen as worthy to appear in a contest. The harder the competition between writers is and the younger and less experiences the writer is, the stronger this feeling is. I still remember my first writer's letter — a single line "Ok, HS SRM 34 is yours" was enough to drive me from an abyss of depression to the heights of pure happiness, and for several more days I had a bounce in my step :-) Nowadays the novelty of this feeling has worn off, and conversations about which round is mine and is it at all became routine, but it lasted for a good few years.
- the joy of creation. Whenever I'm asked what's good about the programmer's job, I recall this special moment I had when I was writing a visualizer for BounceOff Marathon. After hours spent in futile attempts to make the ball move the way I want it to, after tens of trajectories, some of them absolutely insane, all of a sudden there is was — the perfect trajectory! Well, this part of code was completely rewritten later, but the moment of pure joy of creation stays with me forever.
- the sense of accomplishment, from a job done well generally and from reading positive feedback in particular. The most valuable praise it that by the contest admin — both due to the prospect of future contests and to its scarcity. The best praise I've ever got was "The polygon problem turned out really well. I just wanted to say it was a great problem." for PolygonArea, the key problem in my writer's career.
- the feeling of disengagement once the results of the contests are official — it's over! No more last-second changes, no unexpected corner cases, nobody challenges the reference solution, everything is all right. Well, sometimes this part fails, but I'll get back to it later.
- the deep-seated (just to be polite) gloat about the tricky corner case you've hidden in a simple problem. Just look at AgeEncoding, in which all special cases were uncovered by less than 10% of people!
Of course, this is only one side of the coin, and the second one shines nowhere near that bright. Inventing ideas of problems is sweet, but shaping them into usable state takes a lot of effort. The rumor is, a seasoned problemsetter can complete a Div2 round of five problems in a day, but I spend at least a week on the same task. Some types of problems I've forsworn to write — for example, labyrinth-based ones; don't remember the exact problem, but I spent several days on generating decent tests for it. I can write a Marathon in three evenings (and that's my personal best) or in two weeks, especially if it's a real-life one.
That was routine; the other inhabitants of the downside are situations I can't call anything better than a fuck-up — failed reference solutions, missing test cases and such. Luckily, technical problems with the contests don't count here (most people don't blame problem writer in these cases), but other than that, troubles are aplenty. My very first Marathon DeepMining had a bug — the area explored by the robot was generated differently depending on the robot's route — and we realized this only after the contest end. At that point I was using Java for around two months and didn't know that using setSeed on a random numbers generator doesn't define its state uniquely. In TrianglesBoard I forgot that Arena disallows entering strings longer than 50 characters (MPSQAS doesn't) and set constraints as "1 to 50 strings, the length of each string equals 2*its index"; this meant that one couldn't test their solution or challenge other people's ones on big cases. This is one of the reasons I strongly prefer Marathon matches — in a week or two one can fix any problem without it becoming ultimate. A lot of troubles which would have made an SRM unrated become fun stories in Marathons, like my favorite New Year story — you know, the one about me fixing a scoring function all through New Year's Eve.
Finally, the emotions are not always positive, as well as the feedback. You name a thing, and I've probably heard it in the years I spent setting problems. Two of my favorite cases are:
- SubwayTrip featured an escalator; a contestant from a certain country pointed out that escalators are uncommon in this country, so people from it couldn't get the problem right.
- the author of a certain problem doesn't know any math; otherwise she would use the exact formulas in the statement instead of unclear words! By the way, the author doesn't know any Russian, from pretty much the same reasons.
This all sums up to more proc than cons, so I keep setting problems on and on. See you at the future contests ;-)