Search This Blog

How do I learn competitive programming as a beginner?

Here is a step by step procedure. Some of it can/should be done in parallel.

Learn a subset of C++. In Ubuntu, the compiler g++ is already available and if are using latest version then it also supports C++11 and C++14 standards. Use them. Some features make your life very easy. You don’t need to learn about Object-Oriented programming features like classes, inheritance, constructor, destructor etc. You may not even need to learn about templates although they are quite interesting. Think of it as enhanced C.

Practice, practice and practice - I know that this is a cliche. But there is no shortcut. But you might ask how to practice? I think you already know about sites like Codechef, Hackerrank, Codeforces, SPOJ, TopCoder. In SPOJ, solve 200 to 300 most solved problems. It will teach you the concepts which you haven’t learned in the previous step. In Codechef, start from the Beginner section, move to Easy, once you are confident try Medium and Hard. In Codechef and Hackerrank, editorials are pretty good. If you are stuck, read, understand and implement the ideas mentioned.

Participate in contests and “upsolve” - Participate in lot of contests conducted in various sites, be it Codechef’s monthly contests, Codeforces’ regular contests, Hackerrank’s Week of Code, 101 Hack, Hour Rank, World Codesprint, TopCoder’s SRM. Don’t bother too much about ratings - remember that it is just a number calculated by some formula. I have seen some people giving up after their rating crashes. I was one of them for some time. Read the editorials or others’ code for the problems that you couldn’t solve. Learn the ideas involved and implement on your own. This is called “upsolving” and it is very important.

Don’t look for a silver bullet and never stop learning - It doesn’t exist. You have to continuously learn new concepts and update yourself as you climb the ladder. You should also sharpen your discrete math skills besides programming. Remember that competitive programming is all about algorithms, data structures and discrete mathematics. You have to learn plenty of things on the fly. You will experience this if you participate in Codechef long contests. The last few questions are terribly hard.

Popular Posts

Computer programming is one of the fastest growing field. If you are a programmer then you can be hired by a top tech company or you can also work as a freelancer and earn decent amount. So the question arises, how to learn to code ? Initially it was very difficult to learn programming. As there was no internet and you have to relay on books or your colleagues’ code. Now you can find tons of material on the internet. You can learn any computer programming language you want. I am going to tell you some sites which you should visit regularly.

Huffman Code compress data very effectively: saving of 20% to 90% are typical, depending on the characteristics of the data being compressed.Huffman's greedy algorithm uses a table giving how often each character occurs (i.e., its frequency) to build up an optimal way of representing each character as a binary string. This algorithm constructs an optimal prefix code called a Huffman Code.

What is namespace?"In general, a namespace is a container for a set of identifiers Namespaces provide a level of direction to specific identifiers, thus making it possible to distinguish between identifiers with the same exact name. " Or According to Wikipedia “In computer programming namespaces are typically employed for the purpose of grouping symbols and identifiers around a particular functionality and to avoid name collisionsbetween multiple identifiers that share the same name.”