Laid low by a single equals sign
Posted in Computing, Events on September 1st, 2005
Tonight was Round 3 of the TopCoder Open, and I came this close to making the top 100 to go on to Round 4, in fact missing it by a single equals sign… As it is, I placed 138th, so I’m on my way out of this year’s Open, having gotten a round farther than I ever had before, which is very cool.
The first problem wasn’t too bad, but the second problem was a complete bloodbath. It wasn’t terribly hard (some fairly straightforward algebra), but there were quite a few tricky cases. I submitted it in fairly reasonable time, but then went back to check it over because I was nervous about a problem with that many cases to sort out. A good thing, too, because I did find a pair of cases that I’d overlooked. I repaired those and resubmitted, and was pretty confident about my solution at that point.
My confidence was misplaced, however, and I (and about half the known universe) was successfully challenged on that problem, which was a definite bummer. So many people lost their second problem in the challenge and system test phases (less than a third survived), though, that I actually moved up from 155th to finally place 138th out of 191. The stinker is that it turns out that the only mistake in my solution was a single equals sign. Removing that, changing a less than or equal to a less than, fixed it. If I had gotten that problem correct then I would have placed in the low 60’s, qualifying for Round 4 and earning a few more bucks. Or if I’d been faster with a challenge and gotten 50 points for that I would have been in the 90’s and still qualifying.
Sigh.
All that said, there are no doubt dozens of people kicking themselves right now for little things, and in the end what counts is what you do, not what you could have done.
Tonight was a great example of how incredibly careful and precise one has to be about the details in programming. Programs tend to not fail gracefully - they either work or they don’t. My program returned 100 on the test case in question when it should have return -1, and I can construct a (literally) infinite set of cases it will fail on, with the differences from the expected value being as large as you’d like. It may have only been a single character, but it was still absolutely wrong and I (rightly) got no points for it. And that’s big part of what I love about computing - it’s a kind of problem solving that requires both creativity and precision, and which has real consequences.
I’d told WeatherGirl before I went off to compete that, on the assumption that I wasn’t going to make the top 100 and qualify for Round 4, I was hopingfor something like 150th; not too close to 200 to feel totally incompetent, but not so close to 100 that I’d kick myself for every little thing that might have been. 138 is pretty good, then, and I’ll just have to put that equals sign behind me :-).
No tag for this post.