How to Start Competitive Programming ?



Before talking about competitive programming I would like to talk about what is Competitive Programming?

Competitive Programming:

Generally competitive programming is a mind sport where everyone showcase his/her skills of problem solving under various constraints(that force everyone to think deeply or efficiently). Anyone who does competitive programming can enhance his/her problem solving approaches.You will learn how to approach a problem with the best of the best possible ways, you will learn how to analytically think and solve a problem and analyze it's space and time complexity.

Key steps in learning Competitive programming:

1. Choose any well known programming language used for Competitive programming:

You can do competitive programming in any programming language but it is highly recommended that you choose one of C/C++ or Java. The reason being that the time of execution is a key factor in Competitive Programming and so, choosing a language whose time of execution is fast is surely going to give you a benefit. C/C++ and Java are relatively faster, particularly when compared to languages like Python. Python is slow as compared to C/C++ and JAVA,that's why very less number of programmers used to do Competitive Programming in Python due to its time factor which is highly prioritised in Competitive Programming.

2. Choose some platforms to practice Competitive programming and to participate in contest:

As per my personal experience if you are a beginner i will recommend everyone to start with HackerRank,it has really the best user interface and IDE. HackerRank has a good set of problems for beginners placed in well defined manner according the tags and difficulty levels.The main thing that HackerRank provide to the users is that if you get stuck on some problem from very long time and only passing some of the test cases, then you can download the test cases and you can review your logic to do some modifications,it will help in thought process to be able to think about corner test cases.But seeing the test cases is not always good, after some duration(about 2 or 3 months) you itself should be able to think that which test case might give WA(wrong answer). And after the practice of 2 or 3 months you can also start doing practice and participating in contests on some of these famous sites CodeChef,CodeForces,AtCoder. CodeChef is known for long challenge(10 days duration),CookOff(2.5 hrs),LunchTime(3 hrs). Codeforces is known for short duration contests of atmost 3hrs long.

3. Get your hands dirty in Data Structures:

Data Structures are something that helps you in making the program more efficient. Having good amount of knowledge in Data Structures will help you in selecting the optimal Data Structure for any problem. Anyone can learn Data Structures from GeeksForGeeks, it contains Data Structures tutorials and problems in rich amount.

4. Get your hands dirty in Algorithms:

Competitive programming combines two topics: (1) the design of algorithms and (2) the implementation of algorithms. The design of algorithms consists of problem solving and mathematical thinking. Skills for analyzing problems and solving them creatively are needed. An algorithm for solving a problem has to be both correct and efficient, and the core of the problem is often about inventing an efficient algorithm. Theoreticalknowledgeofalgorithmsisimportanttocompetitiveprogrammers. Typically, a solution to a problem is a combination of well-known techniques and new insights. The techniques that appear in competitive programming also form the basis for the scientific research of algorithms. The implementation of algorithms requires good programming skills. In competitive programming, the solutions are graded by testing an implemented algorithm using a set of test cases. Thus, it is not enough that the idea of the algorithm is correct, but the implementation also has to be correct. A good coding style in contests is straightforward and concise. Programs should be written quickly, because there is not much time available. Unlike in traditional software engineering, the programs are short (usually at most a few hundred lines of code), and they do not need to be maintained after the contest.

5. Keep Practicing practicing …….. Practicing:

Always keep yourself motivated enough to solve the problem, it will help you in enhancing your problem solving skills. As now you have good knowledge of Data Structures and Algorithms you can do really well in world of Competitive programming if you keep practicing continuously.

Some useful YouTube links for Competitive Programming:




Conclusion:

So to master the Competitive Programming you need dedication, patience and continuous practice to solve the problems as many as you can.

Code,sleep,eat and repeat.

Enjoy Coding !

~Kuber Khandelwal


Post a Comment

0 Comments