ProgComp 2006
UNSW ProgComp was today (it was also in the middle of our School Holidays, but that’s a different story.) The competition, on the whole, was generally easy – but the real difficulty lay in the interpretation of the problem.
After a lack of competitions for a few months, it took a while to get back into the swing of things, definitely not helped by the standard of Question 1 – not hard, but extremely fiddly. We left it until last.
Question two involved converting suburb names to legible abbreviations, by removing vowels in certain places, and spaces. I did this question in AWK, as its Regular Expressions engine would prove useful – it did. After getting used to the Syntax, I had it solved within 10 minutes (far too long).
Question three was a simple question, which required decoding of a string encoded with “Run Length Encoding” – similar to the stuff they do with ZIP files. It was just a matter of reading in several lines, and not stuffing up ;). Solved using C++, in < 5 minutes.
Question four was a simple number processing one – process a round of World Cup tipping for one match. It was an easy task at first, except that my typing was below standard, and I mistyped a few variable names – wouldn’t have been a problem if I’d used C++, but I used AWK, and as such didn’t get variable name warnings as I ran the program. Solved, and happy!
Question five involved validating (and optionally constructing) magic squares. C++. I love it when “Difficult” questions can be solved using nested for loops looking over arrays. We decided not to do the extension, and instead, go back to question one.
Question one is one of those questions you hate to see in programming competitions – State Machines. There’s no real set logic to them – you just write code, and add extra logic to remove errors in your output. A real doosey for the first up – C++, 18 minutes.
All in all, we were fairly successful (we hope). And we’re now looking forward to a trip to Sydney during the September Holidays!