Competitive programming is well defined system in solving the problems by writing computer program under the specified limits. It has three main aspects. They are well-defined problems, computer programs, and specified limits. First one is well-defined problems that you’re presented with more than one problem. This problem statement contains variable and ability to answer the given problem if there is any possible combination of variable and values. A problem can be well defined and you will inform an exact constraint of all variable and any necessary assumptions.
The second one is a computer program where you can write a problem and also solve the problem. Please note that the computer program is a very simple command line program. There is no fancy of GUI or web application etc. The command line program may really use all the values of a variable from the standard input. You must write a program and get the answer to the standard output.
The last aspect is specified limits. Your computer program must be running and producing an exact result within specified memory limit and time. You must write a program in a set of allowable program languages.
To make sure it is very clear, let’s take the probability of getting a nagging question at your mind. Once you decide that you need to learn code by competitive programming, there is no standard process of learning the code. You can hire freelancers with competitive programming, which is very easy to learn and devote some amount of effort and time. You can develop a strong grasp of competitive programming logic in short time period.
Some steps help you to get begin and be good:
- Get comfortable to write in one of those languages are C, C++, and Java. The use of C, C++ and Java code is very common because these are standard languages that allow in the programming competition.
- If you’re already good at C language, then you must learn C++ language. It is one of the most popular languages among the competitive programmers because of its excellent library and speed in the STL form.
- Choose an online judge that is highly recommended ones like code forces or top coder. Some popular judges include code chef, hacker earth and SPOJ.
- A freelance work starts with a simple problem, which typically requires transforming English into code, but does not require any algorithm knowledge.
- In the early stage of programming, people tend to write lengthy codes, which is not actually required. So you can try to keep your codes simple and short.
Implementing the basic algorithms:
Graph algorithms: Depth First Search (DFS), Dijkstra, Minimum Spanning Tree (MST), Strongly Connected Components (SCC), Breadth First Search (BFS), Floyd Warshall and Topological Sort.
Number theory: Fermat’s theorem, Logarithmic exponentiation, Euler’s totient function, Modular arithmetic, Chinese Reminder Theorem (CRT), Sieve of Eratosthenes and Euclidean method for GCD.
Dynamic programming: Standard problems of dynamic programming like Matrix chain multiplication, Rod cutting and Knapsack.
Basic data structure: Queues, Heaps, Stacks and Trees.
Data structure in advanced: Fenwick tree, Disjoint data structure, Binary Indexed Tree (BIT), Trie and Segment trees.
Greedy: Standard problems like activity selection.
Search techniques: Ternary search, Meet in the middle and Binary search.
String: Z algorithm, Knuth Morris Pratt (KMP) and Suffix arrays or trees (advanced in bit algorithm).
Game theory: Grundy members, Sprague-Grundy theorem and Basic principle of Nim game.
Computational geometry: Graham Scan for Line sweep and convex hull.
Find the implementation and description of standard algorithms:
- Once you have got enough knowledge of most popular algorithms, then you must begin with medium level of solving the problems. That is P2 all the problems in code forces and top coder. It is not advisable to go for P1500 at this point.
- Learn coding is all about practicing. You can regularly participate in a programming contest. Solve ones that you have not solved in the contest. Apart from the code forces and top coder, you can see the code chef contest or hacker earth challenges.
- Read the code that is highly rated by a programmer by comparing your solution with others. You can infer that, it is very simple and shorter than your solution. By this you can analyze how they have to approach and improve your implementation skill.
- The editorials will read after the contest. You must learn how to solve all problems, which were difficult for solving in the contest and learn an alternative way to solve their problems.
- You must always practice the problems so that you can solve the problems in the contest. If you’re able to solve P2 250 and 500 in a contest, but, not P2 1000, then you have to practice more number of P2 1000 problems.
- Don’t spend too much time, if you are not getting solutions or stuck in somewhere.
- After that, if you feel having spent much time, then you have to look at the editorials. Finally, you will understand that finding the real solutions for the code and algorithm is very difficult and you tend to write codes on your own.
- Programming is a practice that is a skill in hand. A freelance work is a continuous task, which one has to learn and write the code to become expert in it. It is enough to solve their problems theoretically. You have enough knowledge to write the code and get accepted solution. Knowing about the logic and algorithms implemented in two different things, which may take both of them to be good at competitive programming.
- Learning the competitive programming is regularly going to take lots of time and practicing the key. It takes some amount of time before you’re attempting P1 500 and many other tough problems. Don’t give up on reading editorials and implementing it even if it takes many days or hours. Note down that very soon the hire freelancers will get placed everywhere after having practiced and mastered in the course.
Learning code computer programming takes some amount of time before getting good at it. You may feel impressive and motivated by yourself throughout the course. Forming a team and practicing is a good choice but never give up the key of success. Doing competitive programming improves your ability to solve problems, gives persistence, and ensures your confidence level.