Competitive Programming (CP) Roadmap
1. Pick a Programming Language
- Choose a programming language to start with. The most commonly used languages for competitive programming are C++, Java, and Python.
- If you aren't familiar with any of these, C++ is recommended since it is widely used in competitive programming and has a large number of resources.
- Recommended resource: LearnCpp
2. Learn Basic Programming
Before starting CP, make sure you are comfortable with:
- Variables and data types
- Conditional statements
- Loops
- Functions
- Arrays and strings
- Pointers and references
- Basic OOP concepts
- Recursion
3. Start Participating in Contests
Don't wait until you feel ready. Start participating in contests as early as possible.
- Participate in contests on Codeforces, CodeChef, and AtCoder.
- Initially, focus on just improving yourself and do not worry about rating.
- After each contest, upsolve problems that you couldn't solve during the contest.
- Before reading the editorial, spend some time trying to solve the problem yourself.
- After reading the editorial, implement the solution yourself and make sure you understand the underlying idea.
5. Practice Problem Solving
Start with easier problems and gradually increase the difficulty.
You should aim at practicing problems that are difficult for you but is still in the doable range. This is usually 200-300 points above your current rating. Solving above your level is the fastest way to get better.
Recommended platforms:
- CSES - Constains a lot of topic wise standard problems. (Must do)
- Codeforces Problem Set
- USACO Guide - Topic-wise learning resources and curated problems.
- cp-algorithms - Detailed explanations and references for specific algorithms.
6. Continue Learning New Topics
As you get better you will come across a lot of new algorithms and ideas you need to know. Not knowing them and learning them after failing to solve a problem related to it is generally a much better approach than just blindly learning topics which you might never encounter in an contest as it is of a rating range much above your current level.
Codeforces Rating vs. Topic List
0–999 Rating
Vital Topics
- Brute Force
- Sorting
- Strings
- Basic Mathematics
- Floor and ceiling
- Modulo
- Divisibility
- Basic arithmetic
- Basic Time Complexity - Big-O notation
- Arrays and Basic Data Structures
Helpful Topics
- Number Theory
- Divisors
- Prime numbers
- Factorization
- GCD / LCM
- STL / Standard Library
- Prefix Sums
- Binary Search
- Two Pointers
- Bitwise Operations
1000–1199 Rating
Vital Topics
- Everything from the previous section
- STL / Standard Library
- Binary Search
- Prefix Sums
- Two Pointers
- Basic Number Theory
- Basic Greedy Algorithms
- Basic Combinatorics
Helpful Topics
- Bitwise Operations
- Recursion
1200–1399 Rating
Vital Topics
- Number Theory
- GCD / LCM
- Prime factorization
- Modular arithmetic
- Binary Search
- Two Pointers / Sliding Window
- Prefix Sums and Difference Arrays
- Greedy Algorithms
- Basic Combinatorics
- Recursion
- STL / Standard Library
Helpful Topics
- Bitwise Operations
- Disjoint Set Union (DSU)
- Basic Graph Algorithms
- Basic Dynamic Programming
- Basic Trees
1400–1599 Rating
Vital Topics
- Dynamic Programming
- Graphs and Trees
- Number Theory
- Binary Search
- Greedy Algorithms
- Combinatorics
- Range Queries
- Bitwise Techniques
- Constructive Problems
- Proofs and Problem-Solving Techniques
Helpful Topics
- DSU
- Minimum Spanning Tree
- Shortest Path Algorithms
- String Algorithms
- Hashing
- KMP / Z-function
- Basic Game Theory
- Probability / Expected Value
1600–1899 Rating
Vital Topics
- Dynamic Programming
- Graphs and Trees
- Shortest Paths
- MST
- DSU
- Tree algorithms
- Data Structures
- Segment Tree
- Ordered Sets / Maps
- Number Theory
- Modular arithmetic
- Prime factorization
- Sieve techniques
- Modular inverses
- Combinatorics
- Probability and Expected Value
- Bitwise Techniques
- Binary Search on the Answer
- Constructive Problems
- Proofs and Mathematical Reasoning
Helpful Topics
- Advanced Graph Algorithms
- LCA / Binary Lifting
- Advanced Tree Techniques
- Advanced String Algorithms
- Game Theory
- Advanced DP
- Monotonic Stack / Queue
1900+
At this point, learning individual topics becomes less important than developing problem-solving ability.
You should be comfortable with most standard CP techniques and focus on:
- Recognizing patterns quickly
- Combining multiple techniques
- Developing solutions from observations
- Proving your approach
- Constructive thinking
- Advanced DP
- Advanced graph algorithms
- Advanced data structures
- Number theory and combinatorics
- Regular contest participation and upsolving
At higher ratings, it is common for a problem to require multiple concepts together, rather than a single known algorithm.
Best of luck on your Competitive Programming journey!
