Competitive Programming

Competitive programming is a competitive event where an individual, or team, must solve a given problem by either developing an algorithm, proving a theorem, implement code, or a combination of all three within a given time frame. Actual computer usage may or may not be involved.

The Association for Computing Machinery (ACM) hosts a yearly international competition, based on local, regional, and national teams. The competition format is groups of three students, given only a single computer, must solve as many of the given problems within five hours. Problem include a description, input and output format, as well as data as an example and it's output. Supported languages include C, C++, and Java all compiled through the GNU Compiler Collection. The given computer for each team runs a form of UNIX, usually a free distribution of Linux. Judging is based on an online submission system, with the team that has the most accepted submissions winning. Each problem is solved by implementing a program that solves a given case, based on an input format, and must format to a specific output. No external references are allowed, though language and library documentation is provided on said computers.

Tutorial
Club member Jeremy Bridon has competed several times and enjoys these competitions. He has written a three-part tutorial for the public to read through, as an introduction to the ACM competition format. Contact him if you are interested in forming a Penn State team or need help with a given problem.

ACM Programming Challenges Tutorials:
 * Part 1
 * Part 2
 * Part 3

Tips & Tricks

 * Algorithms are key - If you are focusing on "programming" your way to the solution, you are doing it wrong! Almost all competitive programming problems are based on finding or creating an algorithm; the implementation should be trivial.
 * Keep is super simple - Simple and clean solutions are usually the best approach. These solutions may be complex, but the implementations will always be clean and simple.
 * Get comfortable with input / output - Take advantage of your programming language's libraries for I/O manipulation; don't do char-by-char management, but know how to do static-precision output.
 * Stay calm, focus on one item at a time - Even in a team, it's better to focus on one problem at a time, from the easiest to hardest. Though spreading work may sound like a good idea, most people rarely solve these kind of problems by themselves. Also, buddy-programming is a great way to get the program done right the first time.
 * Get familiar with VI/GCC/GDB - Make sure you are comfortable with the system you are developing for!
 * Use standard libraries - The C/C++/Java standard libraries include powerful features such as stacks, quick-sort implementations, and plenty of other helpful structures and algorithms. Make absolutely sure you know of the differences between compilers; many features in Visual Studio and GCC do not mix well.
 * Do not use OOP - Never *ever* use object oriented programming features. Hacking your solution together as fast as possible is what matters, not "good programming practices".
 * Over-allocate data, but be reasonable - Allocate more than you need, just to be safe, preventing off-by-one errors. On the other hand, be reasonable: don't allocate so much you run out of memory at run-time.
 * Be an expert in C/C++ pointers and memory management - Some problems will require you to do plenty of dynamic memory allocations. You should know how to do that, it's cost at run-time, and how to release these kind of allocations.