How to do competitive programming : In this article, we will be talking about Competetive Programming. What is the language you should use? What are the best websites for programming competitions? And I’m going to give you some other resources that will help you when you start. I am also going to tell you what is the strategy you should follow as a beginner to keep improving at CP.
If you are wondering what is Competitive programming comment below the article. So let’s get started.
How to do competitive programming? What programming language to chose?
Before participating in programming contests you need to have a decent grasp of a programming language. C++ is easily the most preferred language for CP and Java is the next best. Pick C++ as your starting language unless you’re already familiar with Java. The reason for that is other languages are either really slow or don’t have something like those standard template library or STL of C++ which basically provides standard implementations of some vast used algorithms and data structures.
You don’t have to worry about STL as a beginner but you will need it as you keep on improving and getting better. If you already know some other language, you can start solving some basic beginner problems for now as most of them can be solved by a lot of languages. For learning C++, I would recommend this 10-hour tutorial on Caleb Curry’s channel. If you like books. I would recommend doing the first ten chapters of C++ Primer Plus.
What is the best website for CP?
Codeforces is probably the best CP website on the planet. So you should definitely make an account here. Codeforces has around two contests in a
week, categorized by division. Division 1 is the hardest and division 4 is the easiest. As a beginner, you can take part in Div 2, 3, or 4 Contests.
The contest usually runs for two to two and a half hours. There are usually five to seven problems sorted by difficulty. Each problem has some points. Harder problems obviously have more points. The points keep on decreasing as time goes on so you want to solve the problems as fast as you can. There are also penalties if you submit a wrong solution to the problem.
Codeforces and Atcoder are the top websites of all the great competitive programmers. Atcoder organizers around one contest per week. As a beginner, you should take part in the Atcoder Beginner Contest.
Problems also have points in Atcoder contests but here you get full points for solving a problem. Compared to Codeforces. Ties are broken on the basis of time it took you to solve all the problems plus five minutes for each wrong submission on problems that you eventually solved. The solution for all problems is released the same days after the contest. You can see in the editorial section.
Codeforcse usually has a post where they discuss the Atcoder contest. People often post the solution there and you can look there to see the solution, just immediately after the contest. You can also look at the code of other participants but it’s a bit complex.
Atcoder doesn’t really tell you much about the test cases even after the contest is over. It just tells you how many test cases your solution failed on and how many it passed. Even during the contest. So that is all about the
platforms for programming competitions.
Atcoder Beginner Contest. I recommend doing A and B from the Atcoder Beginner Contests. You can also check out SPOJ or Sphere Online Judge. Which is basically a judge with the collection of problems.
I know there are a lot of other websites for CP but these are the best ones. So my advice is to participate mainly in these two. But before participating in contests it’s a good idea to solve some problems to get used to these CP problems. So for that, you can use either the Codeforces Problem set.
Competitive Programming free pdf book
We have a free pdf with lots of topics and great information about competitive programming. You can start reading it now as it is made for beginners. It’s called the competitive programmer’s handbook.
Conclusion: A lot of people tend to quit in the beginning because they don’t make any progress and it becomes frustrating for them. So following the right strategy is very important. To give a few steps to follow we have a dedicated article you can read it from here.