How we got prepared for a programming contest
I was interested in algorithmic programming contests during my undergraduate years. The idea in these contests is to solve an algorithmic problem in your favorite programming language. A judge, another piece of code, checks correctness of your solution with a number of test cases. Your code should pass all tests. In most cases, judges check execution performance too: your code should execute within the allowed time/memory limits.
There are a number of prestigious programming contests that are known world wide. We, as a team, wanted to compete in ACM International Collegiate Programming Contest (ICPC). If you aim high, the preparation is a long (~2 years) and tedious (full of practice) process. This wasn't the case for us as we were one of the first groups which wanted to compete in such competitions in the country. We signed up for a regional ICPC contest taking place in Bucharest, Romania.
As a start, I practiced by coding solutions for questions from a number of websites. These websites offer free judges and problem sets. They generally have tutorials on competitive programming and let you test your solutions. Check out some of these websites and go over the problems they have:
- Uva Online Judge: It has huge number of problems in various difficulty levels. It offers some basic statistics about specific problems and users.
- Sphere Online Judge: It has less number of problems than Uva Online Judge. The ability to keep track of the memory usage and speed of your submission is an important advantage. It also offers "ranks". You can display various lists ranked by languages, institutions, countries, users etc. Competing against your friends in your university and trying to increase your position in these lists motivate you to solve more problems!
- TopCoder: It is the most useful to develop skills needed for quick and error-free problem solving ability. It offers helpful algorithm tutorials and organizes a bunch of competitions. In these competitions, you are asked to solve different problems in a time range and you compete against others. Members are classified according to their performance and given a color as a sign. This is a clear and widely-used indication of your performance. The unique part of TopCoder is that you can also experience testing. In the end of periodical contests, you are given some time to look for bugs in other submissions. This is where you collect more points by generating inputs that make other submissions fail. In the end, automated tests are run on the solutions. Number of correct submissions for the problem determines the reward.
- UsacoGate: UsacoGate stands for Usaco (USA Computing Olympiad) Training Program Gateway. In this website, you can go over a detailed tutorial step by step. You are asked sample questions related to the algorithm so that you can play with the algorithm.
The more you practice on these judges, the better you will perform during programming contests.
On-site training was the second step. We organized events at METU (in Ankara, Turkey) and invited Vasyl Biletskyy, a member of a former ACM ICPC winner team. We spent a week studying useful algorithms, held contests in which we competed with each other, discussed solutions for the problem sets and received various answers to our questions. Although one can prepare well enough by solving harder and harder problems, it was helpful to learn from an experienced coder.
The final step was to organize practice contests to be ready for the contest environment. We used a mix of questions from the judges I listed above and discussed our algorithms with each other.
Although we, as a team, didn't have a good result in the contest, it has changed how we view coding and allowed us to experience what it takes to win such a competition. I hope this post can be a good starting point for those who consider competing. Good Luck!
February 2014