This was one of my first competitions of this style, and not sure what I think of it.
These are my thoughts:
First impression: these are not really programming problems. These problems are to programming akin what tesuji puzzles are to playing go. But fair enough.
In this contest, the technique to solve most problems were pretty straightforward (
A: sorting,
B: set covering+exhaustive search,
C: greedy+dfs,
D: packing+DP,
E: loops - all "tesujis" familiar to me). Hacking down the code for those took only a few minutes each.
Instead the challenges are in other areas. The lessons I learnt here are:
- Check all "silly" corner cases - the test problems seem to be geared to trip you up if you don't
- Read the spec carefully (failed D a few times because I did not print out the solution in the right order)
- Rewrite - don't debug. All of the problems I solved took less than 15-20 mins to hack down, while debugging some corner case can take significantly longer. Delete. Rewrite. That is more time efficient.
Unfortunately those are not really the "fun" part of programming.
One problem was really challenging though.
F, the XOR sum. I liked it.
My initial gut feel was that this is a quite hard problem, maybe not even polynomial?
Considering the input sizes used to test, there must be a pseudo-linearish time trick to it. Tried something potentially computationally heavier, but it failed a test problem in the latter half. Tried to revisit it in the last two hours before deadline, but not sure I would have been able to solve it given a full day. Any hints?
Also giving an advantage to whoever submits first is not ideal. Better would be to judge the solution quality (like problem
C - make it print a solution with as few pubs as possible (or smth) - and the fewer the better your tie-break) or give better tie break by execution time / memory usage (the faster solver the better).
Since I am in Asia, these contests start like 2am my time - which means by the time I wake up people should have solved most of the puzzles already. In 7-8h I would have solved 4 or 5 of the puzzles in this round, and I would expect nothing less from you
Let's see if I do this again.