CodeJam Round 2 Recap


2021-06-11T13:38:37+02:00
Code Jam gcj2021

I’ve waited too long to write this. Memory’s getting fuzzy, I’ll have to try and infer stuff from local files’ mtimes and whatever the platform remembers from my (precious few) submissions.

Anyway, I have write-ups for the individual problems, that ought to spark something:

Memory aids revisited, it does appears I did them in order.

As the write-up hinted, I had the wrong intuition on Minimum Sort, and spent a lot of time trying to prove the solution wrong, without taking a step back to notice it was a single-test fully visible-results problem, with no guesswork needed to ensure validity of a hidden set. Mess-up number 1: assuming too much.1 It went ahead pretty fast once I accepted the situation.

Matrygons took a bit of time in the start, because my mind didn’t want to interpret the summation at the correct level. Once that got settled, the implementation followed easily. A wee bit of optimization was needed to go from TLE to AC on the large set: migrating from Data.Array to Data.Array.Unboxed.

I never wrote a bruteforce “test each one of the 13! possibilities” in Hidden Pancakes, my first and only contest attempt was already close to the tree-based one I describe in the write-up. I recall it took me some time to add a “closed set” of numbers not to be allocated again if they’re not directly comparable because they’re on separate sub-branches. But my 5-minute-past-the-contest update that passed the large set is still a direct continuation of that code branch.

I don’t remember much from Retiling. It’s likely I had my natural revulsion to that sort of problem for some time, then tried going at it anyway. Or maybe I only used my time to struggle with C-large? I don’t remember. I didn’t have a hungarian algorithm at hand anyway; even if I had understood the problem, I wouldn’t have solved it in time.

This concludes the competing aspect of my CodeJam participation for the year. If motivation keeps up, I’ll try and detail a few other problems. See you soon!


  1. Not exactly a mess-up specific to coding competitions. It applies all over the engineering spectrum.↩︎