-
Notifications
You must be signed in to change notification settings - Fork 75
Fundamental Concepts
Try to learn only one programming language very deeply. Use this language to solve problems. This way you spend less time debugging your code and more time debugging your algorithms.
The most common languages are C, C++, PASCAL, and JAVA. C++ is the most used language for contest problems.
Find and attempt the easier problems. These problems are called "ad-hoc" problems (i.e. you need creative thinking to solve but no necessary prior algorithm/mathematics knowledge or experience solving similar problems). Solving these problems can increase your programming capability.
Once you are skilled in coding and solving easier problems, learn algorithms. After understanding the algorithms, try to implement them in the programming language you have learnt.
Use simple algorithms that are guaranteed to solve the problem in question. You are not competing for algorithm elegance or efficiency. You just need a correct algorithm. The simpler the algorithm, the more chance you have coding it correctly on your first try.
This is the most important tip. You don't have time to design complex algorithms. Judging on the size of your input, you can implement the stupidest of algorithms and have a working solution in no time. Don't understimate today's CPUs. It's very difficult to exceed your allowed program execution time.
Writing simple code eliminates chances for trivial errors. If you need to debug the code, it will be much easier to do so.
Use descriptive variable names. The time you waste by extra typing is nothing compared to the gain of having code that speaks for itself.
Try to solve more and more problems. The best competitors weren't built in a day.
When practicing, try to simulate the contest environment. Eliminate distractions, work in a team of three if possible, share a single terminal with your team, use the same tools you'll be using at the contest, etc.
The contest is only 5 hours long. That's 15 man hours and 5 computer hours. So try to solve problems individually to get the most out of those 15 man hours. Computer time is very limited, so it should only be used for typing. Do not debug on the computer, print out the code instead and then switch seats with someone who needs the computer.
Snippets taken from "Art of Programming Contest".