Efficient coding ensures that you complete a task in the smallest time interval possible without complicating your life too much. Now, you do not need to work like this for every little bit of code you type. This approach will be priceless, however, whenever time is of the essence, as it is for a programming contest.
Easy and Efficient Programming for Contests (Page 1 of 4 )
A few of the tricks I will present here are not always the best approach, so use them only when you really need to. For instance, if you are creating a complex application that is being co-developed by a large team, it is a good idea to make everything as clear as possible, rather than inserting complicated code that may drive the others crazy. Nevertheless, at a programming contest, it would come handy.
Most of the tips I will share are the result of years of experience at programming contests or bright thoughts from more inspired people. I invented none of these examples, but I tried them out in my own code snippets, and they work like a charm, creating code that is both simple and fast.
Therefore, I will point out the initial source of these ideas, so make sure to give him all the credit. In this article, most of the ideas came from Alexandru Mosoi. Additionally, note that this is article series about programming contests. In these, I try to answer questions like what they are and why you should participate in them. Finally, I also present a collection of useful tricks that will help you finish out in front.
If you missed the first two parts you can find them at my profile under the names of “Programming Contests: Why Bother?” and “Preparing for a Programming Contest.” Now, as I promised you in the previous articles, let us get on with this.