nibot ([personal profile] nibot) wrote2004-10-05 05:18 pm

berkeley programming contest

A few weekends ago I participated in the Berkeley Programming Contest. Ryan and I had just gone out to breakfast at Mt. Hope Diner, and when we came back I saw that not only had the contest started in Berkeley, but that I'd been emailed an EECS account with which to participate. So, why not? The format of the contest is that you have five hours in which to solve as many of eight problems as you can. I took quite a lacadasical approach this time and managed to solve three of the problems before running off to a birthday party. No longer a Berkeley student, I was not eligible to win anything except the usual "local bragging rights".

Knowing the form and idioms of the programming contest is a significant part of the battle. Almost everybody these days writes their solutions in Java, but I use almost exclusively plain old C because that's the language I'm most familiar with, and it's particularly well suited to the programming contest.

Each programming contest problem asks you to write a program that takes some input describing some situation and then your program must compute something based on that input, and produce output in a particular format. Once you have what you think is a solution to a problem, you submit it by issuing the "submit" command. Elsewhere, your program is compiled, it is fed some input, and your program's output is compared to the expected output.