Skip to content

Instantly share code, notes, and snippets.

@ehsan18t
Last active December 29, 2025 13:18
Show Gist options
  • Select an option

  • Save ehsan18t/281953e4f69b6c955d2fc82f25676092 to your computer and use it in GitHub Desktop.

Select an option

Save ehsan18t/281953e4f69b6c955d2fc82f25676092 to your computer and use it in GitHub Desktop.
This is a list of programming problems from various sites (like LeetCode, Codeforces) and designed in way to take you from zero. All you need to do is follow the serial and solve problems.

πŸ† The Ultimate Competitive Programming Roadmap

From 800 Codeforces Rating to Candidate Master (2200+)

655+ Problems | Multi-Platform | Serial Progression

This roadmap is designed for someone with ~800 Codeforces rating who wants to systematically level up. Follow problems serially from #1 onwards - the order is carefully crafted so each problem builds on previous concepts.


πŸ“š Philosophy & How to Practice

Based on research from top competitive programmers (E869120, -is-this-fft-, TheScrasse):

The Two Pillars of Improvement

  1. "What to Think" - Know standard problems, techniques, and patterns
  2. "How to Think" - Build paths to solutions through practice

Golden Rules

  1. NO JUMPING AROUND - The order is crucial. Earlier problems prepare you for later ones.
  2. STRUGGLE BEFORE SOLUTIONS - Spend at least 30-60 minutes on a problem before seeking hints. The struggle is where learning happens.
  3. AVOID SELF-DECEPTION - Don't pretend to solve problems. If you read an editorial, the problem is "spoiled" - you didn't truly solve it.
  4. UPSOLVE RELIGIOUSLY - After contests, solve at least one problem you couldn't solve during the contest.
  5. ASK "WHY" - After solving, ask: What was the key insight? Why didn't I see it faster?
  6. IMPLEMENT EVERYTHING - Reading solutions is not solving. You must code and get AC.

After Reading an Editorial (Reflection Questions)

From -is-this-fft-'s "Self-Deception" Blog:

When you finally read an editorial (after genuinely struggling), ask yourself:

  • "Why didn't I think of this?" - Identify the specific insight you missed
  • "What observation wasn't intuitive to me?" - Note it for future problems
  • "Is this technique standard?" - If yes, add it to your toolkit
  • "What similar problems could this solve?" - Generalize the approach

Avoiding Self-Deception

⚠️ Warning Signs You're Fooling Yourself:

  • Solving only easy problems and avoiding hard ones ("biased problem selection")
  • Reading hints after 5 minutes instead of struggling
  • Saying "I would have solved it" after reading editorial
  • Rushing through problems for quantity over quality
  • Only solving problems with tags visible

βœ… What to Do Instead:

  • Solve problems slightly above your comfort zone
  • Hide problem tags and ratings when possible
  • Spend 60-90 minutes on hard problems before ANY hints
  • After editorial, implement from scratch without looking

Virtual Contest Practice

  • Do at least 1 virtual contest per week on Codeforces
  • Choose contests from your rating Β± 200
  • Treat it like a real contest (no distractions, timed)
  • Upsolve all problems within your rating reach after the virtual

Time Guidelines per Problem Difficulty

Difficulty Think Time Before Hints
Easy 15-20 minutes
Medium 30-45 minutes
Hard 60-90 minutes
Very Hard 2+ hours (over days)

Platform Legend

  • 🟒 LC = LeetCode
  • πŸ”΅ CF = Codeforces
  • 🟑 CSES = CSES Problem Set
  • 🟠 AC = AtCoder
  • βšͺ Other = SPOJ, etc.

🎯 Milestones & Expected Ratings

Phase Problems Target CF Rating
Phase 0 1-65 800 β†’ 1000
Phase 1 66-145 1000 β†’ 1200
Phase 2 146-215 1200 β†’ 1400
Phase 3 216-295 1400 β†’ 1600
Phase 4 296-395 1600 β†’ 1900
Phase 5 396-445 1900 β†’ 2000+ (Expert)
Phase 6 446-575 2000 β†’ 2100
Phase 7 576-655+ 2100 β†’ 2200+ (Candidate Master)

Phase 0: Fundamentals & Warm-up (Problems 1-65)

Focus: Basic implementation, simple math, brute force, simulation, complete search

Basic Implementation & Math

  1. 🟑 CSES - Weird Algorithm (Collatz)
  2. 🟑 CSES - Missing Number
  3. 🟑 CSES - Repetitions
  4. 🟑 CSES - Increasing Array
  5. 🟑 CSES - Number Spiral ⭐ Pattern recognition - finding formulas
  6. 🟒 LC - Two Sum
  7. 🟒 LC - Valid Palindrome
  8. 🟒 LC - Valid Anagram
  9. πŸ”΅ CF - Watermelon
  10. πŸ”΅ CF - Way Too Long Words
  11. πŸ”΅ CF - Team

Arrays & Simple Logic

  1. 🟒 LC - Contains Duplicate
  2. 🟒 LC - Best Time to Buy and Sell Stock
  3. 🟒 LC - Maximum Subarray (Kadane's Algorithm)
  4. 🟒 LC - Merge Sorted Array
  5. πŸ”΅ CF - Beautiful Matrix
  6. πŸ”΅ CF - Petya and Strings
  7. πŸ”΅ CF - Stones on the Table
  8. 🟑 CSES - Permutations
  9. 🟒 LC - Move Zeroes
  10. 🟒 LC - Remove Duplicates from Sorted Array

Strings & Hashing Basics

  1. 🟒 LC - First Unique Character in a String
  2. 🟒 LC - Ransom Note
  3. 🟒 LC - Isomorphic Strings
  4. 🟒 LC - Word Pattern
  5. πŸ”΅ CF - Boy or Girl
  6. πŸ”΅ CF - Word Capitalization
  7. 🟒 LC - Group Anagrams
  8. 🟒 LC - Longest Common Prefix
  9. πŸ”΅ CF - String Task
  10. 🟒 LC - Valid Parentheses

Simple Math & Number Theory Intro

  1. 🟒 LC - Fizz Buzz
  2. 🟒 LC - Single Number (XOR trick)
  3. 🟒 LC - Missing Number
  4. 🟒 LC - Happy Number
  5. πŸ”΅ CF - Even Odds
  6. πŸ”΅ CF - Nearly Lucky Number
  7. 🟒 LC - Power of Two
  8. 🟒 LC - Power of Three
  9. πŸ”΅ CF - Helpful Maths
  10. 🟒 LC - Pascal's Triangle
  11. 🟑 CSES - Trailing Zeros ⭐ Classic factorials insight
  12. 🟑 CSES - Bit Strings ⭐ Modular arithmetic intro

2D Arrays & Matrices

  1. 🟒 LC - Spiral Matrix
  2. 🟒 LC - Set Matrix Zeroes
  3. 🟒 LC - Rotate Image
  4. 🟑 CSES - Two Knights
  5. πŸ”΅ CF - Anton and Danik
  6. πŸ”΅ CF - Insomnia cure
  7. 🟒 LC - Valid Sudoku
  8. 🟒 LC - Game of Life
  9. πŸ”΅ CF - Bear and Big Brother
  10. 🟑 CSES - Coin Piles

Complete Search & Brute Force ⭐ Essential foundation for all recursion/DP

  1. 🟑 CSES - Apple Division ⭐ Subset enumeration - must know
  2. 🟑 CSES - Chessboard and Queens ⭐ Classic N-Queens brute force
  3. 🟑 CSES - Creating Strings ⭐ Permutation generation
  4. 🟑 CSES - Grid Paths ⭐ Pruned backtracking - builds intuition
  5. 🟑 CSES - Two Sets ⭐ Constructive thinking
  6. πŸ”΅ CF - Generate a String Complete search with memoization insight
  7. 🟒 LC - Letter Combinations of a Phone Number

Simulation ⭐ Directly implementing problem statement

  1. 🟑 CSES - Palindrome Reorder ⭐ Simulation with counting
  2. 🟑 CSES - Gray Code ⭐ Bit pattern simulation
  3. πŸ”΅ CF - Keyboard
  4. πŸ”΅ CF - Chat Room
  5. πŸ”΅ CF - Fox and Snake

Phase 1: Core Techniques (Problems 66-145)

Focus: Sorting, Binary Search, Two Pointers, Prefix Sums, Greedy Basics

Sorting Fundamentals

  1. 🟑 CSES - Distinct Numbers
  2. 🟑 CSES - Apartments
  3. 🟑 CSES - Ferris Wheel
  4. 🟑 CSES - Concert Tickets
  5. 🟒 LC - Sort Colors (Dutch Flag)
  6. 🟒 LC - Merge Intervals
  7. πŸ”΅ CF - Arrival of the General
  8. 🟒 LC - Insert Interval
  9. 🟒 LC - Non-overlapping Intervals
  10. 🟑 CSES - Movie Festival
  11. 🟑 CSES - Towers ⭐ Greedy with multiset - key technique
  12. 🟑 CSES - Collecting Numbers ⭐ Inversions insight

Two Pointers Mastery

  1. 🟒 LC - Two Sum II - Input Array Is Sorted
  2. 🟒 LC - 3Sum
  3. 🟒 LC - Container With Most Water
  4. 🟒 LC - Trapping Rain Water
  5. 🟑 CSES - Sum of Two Values
  6. 🟑 CSES - Sum of Three Values
  7. 🟑 CSES - Sum of Four Values
  8. 🟒 LC - Remove Duplicates from Sorted Array II
  9. 🟒 LC - Squares of a Sorted Array
  10. πŸ”΅ CF - Books
  11. 🟑 CSES - Collecting Numbers II ⭐ Updates with inversions

Binary Search Fundamentals

  1. 🟒 LC - Binary Search
  2. 🟒 LC - Search Insert Position
  3. 🟒 LC - Find First and Last Position
  4. 🟒 LC - Search a 2D Matrix
  5. 🟑 CSES - Factory Machines
  6. 🟑 CSES - Array Division
  7. 🟒 LC - Find Minimum in Rotated Sorted Array
  8. 🟒 LC - Search in Rotated Sorted Array
  9. 🟒 LC - Koko Eating Bananas
  10. πŸ”΅ CF - Hamburgers

Binary Search on Answer

  1. 🟒 LC - Capacity To Ship Packages
  2. 🟒 LC - Split Array Largest Sum
  3. 🟒 LC - Minimum Number of Days to Make m Bouquets
  4. 🟒 LC - Magnetic Force Between Two Balls
  5. πŸ”΅ CF - Aggressive cows
  6. 🟑 CSES - Subarray Sums I
  7. 🟑 CSES - Subarray Sums II
  8. 🟒 LC - Median of Two Sorted Arrays
  9. πŸ”΅ CF - Multiplication Table
  10. 🟒 LC - Find Peak Element

Prefix Sums & Difference Arrays

  1. 🟒 LC - Range Sum Query - Immutable
  2. 🟒 LC - Range Sum Query 2D - Immutable
  3. 🟒 LC - Subarray Sum Equals K
  4. 🟒 LC - Continuous Subarray Sum
  5. 🟒 LC - Product of Array Except Self
  6. 🟑 CSES - Static Range Sum Queries
  7. πŸ”΅ CF - Greg and Array
  8. 🟒 LC - Find Pivot Index
  9. 🟒 LC - Maximum Size Subarray Sum Equals k
  10. 🟑 CSES - Subarray Divisibility

Sliding Window

  1. 🟒 LC - Longest Substring Without Repeating Characters
  2. 🟒 LC - Minimum Window Substring
  3. 🟒 LC - Longest Repeating Character Replacement
  4. 🟒 LC - Permutation in String
  5. 🟒 LC - Find All Anagrams in a String
  6. 🟒 LC - Sliding Window Maximum
  7. 🟒 LC - Max Consecutive Ones III
  8. 🟑 CSES - Maximum Subarray Sum
  9. πŸ”΅ CF - K-th Beautiful String
  10. 🟒 LC - Minimum Size Subarray Sum

Greedy Basics

  1. 🟒 LC - Jump Game
  2. 🟒 LC - Jump Game II
  3. 🟒 LC - Gas Station
  4. 🟒 LC - Candy
  5. 🟑 CSES - Tasks and Deadlines
  6. 🟑 CSES - Stick Lengths
  7. 🟒 LC - Partition Labels
  8. πŸ”΅ CF - Maximum in Table
  9. 🟒 LC - Queue Reconstruction by Height
  10. 🟒 LC - Minimum Number of Arrows to Burst Balloons
  11. 🟑 CSES - Missing Coin Sum ⭐ Greedy invariant - builds key intuition
  12. 🟑 CSES - Reading Books ⭐ Classic greedy scheduling

Greedy with Sorting ⭐ Essential pattern - sorting enables greedy

  1. 🟑 CSES - Movie Festival II ⭐ Multiple attendees scheduling
  2. πŸ”΅ CF - Ladybugs
  3. πŸ”΅ CF - Vasya and Socks
  4. 🟒 LC - Assign Cookies
  5. πŸ”΅ CF - Two Teams Composing

Phase 2: Essential Data Structures (Problems 146-215)

Focus: Stacks, Queues, Heaps, Sets, Maps, DSU

Stack Applications

  1. 🟒 LC - Min Stack
  2. 🟒 LC - Evaluate Reverse Polish Notation
  3. 🟒 LC - Daily Temperatures
  4. 🟒 LC - Next Greater Element I
  5. 🟒 LC - Next Greater Element II
  6. 🟒 LC - Largest Rectangle in Histogram
  7. 🟒 LC - Maximal Rectangle
  8. 🟒 LC - Decode String
  9. 🟒 LC - Basic Calculator
  10. 🟑 CSES - Tower of Hanoi
  11. 🟑 CSES - Nearest Smaller Values ⭐ Monotonic stack foundation - essential

Priority Queue / Heap

  1. 🟒 LC - Kth Largest Element in an Array
  2. 🟒 LC - Top K Frequent Elements
  3. 🟒 LC - K Closest Points to Origin
  4. 🟒 LC - Find Median from Data Stream
  5. 🟒 LC - Merge k Sorted Lists
  6. 🟒 LC - Task Scheduler
  7. 🟒 LC - Reorganize String
  8. 🟑 CSES - Restaurant Customers
  9. 🟒 LC - Maximum Number of Events That Can Be Attended
  10. 🟒 LC - Last Stone Weight

Linked Lists

  1. 🟒 LC - Reverse Linked List
  2. 🟒 LC - Merge Two Sorted Lists
  3. 🟒 LC - Linked List Cycle
  4. 🟒 LC - Linked List Cycle II
  5. 🟒 LC - Remove Nth Node From End
  6. 🟒 LC - Reorder List
  7. 🟒 LC - Add Two Numbers
  8. 🟒 LC - Copy List with Random Pointer
  9. 🟒 LC - LRU Cache
  10. 🟒 LC - Reverse Nodes in k-Group

Disjoint Set Union (DSU / Union-Find)

  1. 🟑 CSES - Road Reparation
  2. 🟑 CSES - Road Construction
  3. 🟒 LC - Number of Connected Components in an Undirected Graph
  4. 🟒 LC - Graph Valid Tree
  5. 🟒 LC - Redundant Connection
  6. 🟒 LC - Accounts Merge
  7. πŸ”΅ CF - Educational DSU
  8. 🟒 LC - Most Stones Removed with Same Row or Column
  9. 🟒 LC - Satisfiability of Equality Equations
  10. 🟒 LC - Number of Islands II

Sets, Maps & Multisets

  1. 🟑 CSES - Playlist
  2. 🟑 CSES - Traffic Lights
  3. 🟑 CSES - Room Allocation
  4. 🟒 LC - Longest Consecutive Sequence
  5. 🟒 LC - Top K Frequent Words
  6. 🟒 LC - Design HashMap
  7. 🟒 LC - Design HashSet
  8. πŸ”΅ CF - Array
  9. 🟑 CSES - Josephus Problem I
  10. 🟑 CSES - Josephus Problem II
  11. 🟑 CSES - Nested Ranges Check ⭐ Range containment - common pattern
  12. 🟑 CSES - Nested Ranges Count ⭐ Counting with data structures

Trie (Prefix Tree)

  1. 🟒 LC - Implement Trie (Prefix Tree)
  2. 🟒 LC - Design Add and Search Words Data Structure
  3. 🟒 LC - Word Search II
  4. 🟒 LC - Replace Words
  5. 🟒 LC - Maximum XOR of Two Numbers in an Array
  6. 🟒 LC - Search Suggestions System
  7. 🟒 LC - Palindrome Pairs
  8. πŸ”΅ CF - Vasiliy's Multiset
  9. 🟒 LC - Stream of Characters
  10. 🟒 LC - Word Break

Bitwise Operations ⭐ Foundation for bitmask DP and XOR problems

  1. 🟒 LC - Number of 1 Bits
  2. 🟒 LC - Counting Bits
  3. 🟒 LC - Reverse Bits
  4. 🟒 LC - Sum of Two Integers
  5. πŸ”΅ CF - XOR and Favorite Number
  6. 🟑 CSES - Digit Queries ⭐ Digit manipulation
  7. 🟒 LC - Bitwise AND of Numbers Range

Phase 3: Graph Algorithms (Problems 216-295)

Focus: DFS, BFS, Shortest Paths, Trees, Topological Sort, Functional Graphs

DFS & BFS Fundamentals

  1. 🟑 CSES - Counting Rooms
  2. 🟑 CSES - Labyrinth
  3. 🟑 CSES - Building Roads
  4. 🟒 LC - Number of Islands
  5. 🟒 LC - Max Area of Island
  6. 🟒 LC - Clone Graph
  7. 🟒 LC - Pacific Atlantic Water Flow
  8. 🟒 LC - Surrounded Regions
  9. 🟒 LC - Rotting Oranges
  10. 🟑 CSES - Message Route
  11. 🟑 CSES - Building Teams ⭐ Bipartite check - essential
  12. 🟑 CSES - Monsters ⭐ Multi-source BFS with path reconstruction

Topological Sort

  1. 🟑 CSES - Course Schedule
  2. 🟑 CSES - Longest Flight Route
  3. 🟒 LC - Course Schedule
  4. 🟒 LC - Course Schedule II
  5. 🟒 LC - Alien Dictionary
  6. πŸ”΅ CF - Fox And Names
  7. 🟒 LC - Parallel Courses
  8. 🟑 CSES - Game Routes
  9. πŸ”΅ CF - Sorting the Arguments
  10. 🟒 LC - Minimum Height Trees

Shortest Path Algorithms

  1. 🟑 CSES - Shortest Routes I (Dijkstra)
  2. 🟑 CSES - Shortest Routes II (Floyd-Warshall)
  3. 🟑 CSES - High Score (Bellman-Ford)
  4. 🟒 LC - Network Delay Time
  5. 🟒 LC - Cheapest Flights Within K Stops
  6. 🟒 LC - Path with Maximum Probability
  7. 🟑 CSES - Flight Discount
  8. 🟑 CSES - Cycle Finding
  9. 🟒 LC - Swim in Rising Water
  10. πŸ”΅ CF - Dijkstra?

Tree Basics

  1. 🟒 LC - Binary Tree Level Order Traversal
  2. 🟒 LC - Maximum Depth of Binary Tree
  3. 🟒 LC - Same Tree
  4. 🟒 LC - Invert Binary Tree
  5. 🟒 LC - Diameter of Binary Tree
  6. 🟒 LC - Balanced Binary Tree
  7. 🟒 LC - Subtree of Another Tree
  8. 🟑 CSES - Subordinates
  9. 🟑 CSES - Tree Diameter
  10. 🟑 CSES - Tree Distances I

Tree Advanced

  1. 🟒 LC - Lowest Common Ancestor of a Binary Tree
  2. 🟒 LC - Validate Binary Search Tree
  3. 🟒 LC - Kth Smallest Element in a BST
  4. 🟒 LC - Binary Tree Maximum Path Sum
  5. 🟒 LC - Serialize and Deserialize Binary Tree
  6. 🟑 CSES - Tree Distances II
  7. 🟑 CSES - Company Queries I (Binary Lifting)
  8. 🟑 CSES - Company Queries II (LCA)
  9. 🟒 LC - Construct Binary Tree from Preorder and Inorder Traversal
  10. 🟑 CSES - Distance Queries

MST & Advanced Graph

  1. 🟑 CSES - Road Reparation (Kruskal/Prim)
  2. 🟒 LC - Min Cost to Connect All Points
  3. 🟒 LC - Connecting Cities With Minimum Cost
  4. 🟑 CSES - Round Trip (Cycle Detection)
  5. 🟑 CSES - Round Trip II (Directed)
  6. 🟒 LC - Critical Connections in a Network (Bridges)
  7. 🟑 CSES - Flight Routes Check (SCC)
  8. 🟑 CSES - Planets and Kingdoms
  9. 🟒 LC - Reconstruct Itinerary (Eulerian Path)
  10. 🟑 CSES - Mail Delivery

Functional Graphs ⭐ Each node has exactly one outgoing edge - common pattern

  1. 🟑 CSES - Planets Cycles ⭐ Essential functional graph
  2. 🟒 LC - Find the Duplicate Number ⭐ Floyd's cycle detection
  3. 🟒 LC - Find All Duplicates in an Array
  4. πŸ”΅ CF - The Tag Game
  5. 🟑 CSES - Planet Queries I ⭐ Binary lifting on functional graphs

Backtracking

  1. 🟒 LC - Subsets
  2. 🟒 LC - Subsets II
  3. 🟒 LC - Permutations
  4. 🟒 LC - Permutations II ⭐ Handling duplicates
  5. 🟒 LC - Combination Sum
  6. 🟒 LC - Combination Sum II
  7. 🟒 LC - Palindrome Partitioning
  8. 🟒 LC - N-Queens
  9. 🟒 LC - Sudoku Solver
  10. 🟒 LC - Generate Parentheses ⭐ Classic recursion with pruning
  11. 🟒 LC - Word Search ⭐ Grid backtracking
  12. 🟒 LC - Combinations
  13. 🟒 LC - Restore IP Addresses

Phase 4: Dynamic Programming Mastery (Problems 296-395)

Focus: All DP patterns including AtCoder DP Educational Contest

DP Introduction

  1. 🟒 LC - Climbing Stairs
  2. 🟒 LC - Min Cost Climbing Stairs
  3. 🟒 LC - House Robber
  4. 🟒 LC - House Robber II
  5. 🟑 CSES - Dice Combinations
  6. 🟑 CSES - Minimizing Coins
  7. 🟑 CSES - Coin Combinations I
  8. 🟑 CSES - Coin Combinations II
  9. 🟠 AC DP-A - Frog 1
  10. 🟠 AC DP-B - Frog 2

Grid DP

  1. 🟒 LC - Unique Paths
  2. 🟒 LC - Unique Paths II
  3. 🟒 LC - Minimum Path Sum
  4. 🟒 LC - Triangle
  5. 🟑 CSES - Grid Paths
  6. 🟠 AC DP-H - Grid 1
  7. 🟒 LC - Dungeon Game
  8. 🟒 LC - Cherry Pickup
  9. 🟒 LC - Cherry Pickup II
  10. 🟒 LC - Longest Increasing Path in a Matrix

Knapsack Variants

  1. 🟠 AC DP-D - Knapsack 1
  2. 🟠 AC DP-E - Knapsack 2
  3. 🟒 LC - Partition Equal Subset Sum
  4. 🟒 LC - Target Sum
  5. 🟒 LC - Coin Change
  6. 🟒 LC - Coin Change II
  7. 🟑 CSES - Book Shop
  8. 🟑 CSES - Money Sums
  9. 🟒 LC - Ones and Zeroes
  10. 🟒 LC - Profitable Schemes

LCS & LIS

  1. 🟠 AC DP-F - LCS
  2. 🟒 LC - Longest Common Subsequence
  3. 🟒 LC - Edit Distance
  4. 🟒 LC - Longest Increasing Subsequence
  5. 🟒 LC - Russian Doll Envelopes
  6. 🟑 CSES - Increasing Subsequence
  7. 🟒 LC - Number of Longest Increasing Subsequence
  8. 🟒 LC - Distinct Subsequences
  9. 🟠 AC DP-Q - Flowers
  10. 🟒 LC - Interleaving String

Interval DP

  1. 🟒 LC - Longest Palindromic Substring
  2. 🟒 LC - Palindromic Substrings
  3. 🟒 LC - Longest Palindromic Subsequence
  4. 🟒 LC - Burst Balloons
  5. 🟠 AC DP-N - Slimes
  6. 🟒 LC - Minimum Cost Tree From Leaf Values
  7. 🟒 LC - Strange Printer
  8. 🟑 CSES - Removal Game
  9. 🟒 LC - Stone Game
  10. 🟒 LC - Minimum Score Triangulation of Polygon

Tree DP

  1. 🟠 AC DP-P - Independent Set
  2. 🟠 AC DP-V - Subtree
  3. 🟒 LC - House Robber III
  4. 🟑 CSES - Tree Matching
  5. 🟑 CSES - Tree Diameter
  6. πŸ”΅ CF - Tree Painting
  7. 🟒 LC - Binary Tree Cameras
  8. 🟑 CSES - Finding a Centroid
  9. πŸ”΅ CF - Choosing Capital for Treeland
  10. 🟒 LC - Sum of Distances in Tree

Bitmask DP

  1. 🟠 AC DP-O - Matching
  2. 🟠 AC DP-U - Grouping
  3. 🟒 LC - Partition to K Equal Sum Subsets
  4. 🟒 LC - Shortest Path Visiting All Nodes
  5. 🟑 CSES - Hamiltonian Flights
  6. 🟒 LC - Find the Shortest Superstring
  7. 🟒 LC - Number of Ways to Wear Different Hats
  8. 🟑 CSES - Elevator Rides
  9. πŸ”΅ CF - Little Pony and Harmony Chest
  10. 🟒 LC - Parallel Courses II

Digit DP

  1. 🟠 AC DP-S - Digit Sum
  2. 🟒 LC - Numbers At Most N Given Digit Set
  3. 🟒 LC - Count of Integers
  4. πŸ”΅ CF - Magic Numbers
  5. πŸ”΅ CF - Classy Numbers
  6. 🟒 LC - Count Numbers with Unique Digits
  7. πŸ”΅ CF - Sum of Digits
  8. 🟑 CSES - Counting Numbers
  9. 🟒 LC - Number of Beautiful Integers in the Range
  10. πŸ”΅ CF - Greg and Graph

More DP Patterns

  1. 🟠 AC DP-G - Longest Path
  2. 🟠 AC DP-I - Coins
  3. 🟠 AC DP-J - Sushi
  4. 🟠 AC DP-K - Stones
  5. 🟠 AC DP-L - Deque
  6. 🟒 LC - Word Break II
  7. 🟒 LC - Decode Ways
  8. 🟒 LC - Decode Ways II
  9. 🟒 LC - Maximum Product Subarray
  10. 🟒 LC - Best Time to Buy and Sell Stock with Cooldown

Advanced DP

  1. 🟠 AC DP-M - Candies
  2. 🟠 AC DP-R - Walk
  3. 🟠 AC DP-T - Permutation
  4. 🟠 AC DP-W - Intervals
  5. 🟠 AC DP-X - Tower
  6. 🟠 AC DP-Y - Grid 2
  7. 🟠 AC DP-Z - Frog 3
  8. 🟒 LC - Regular Expression Matching
  9. 🟒 LC - Wildcard Matching
  10. 🟒 LC - Frog Jump

Phase 5: Advanced Topics (Problems 396-445)

Focus: Segment Trees, Number Theory, Strings, Bits, Game Theory

Segment Trees

  1. 🟑 CSES - Dynamic Range Sum Queries
  2. 🟑 CSES - Dynamic Range Minimum Queries
  3. 🟑 CSES - Range Xor Queries
  4. 🟑 CSES - Range Update Queries
  5. 🟑 CSES - Forest Queries
  6. πŸ”΅ CF - Educational Segment Tree
  7. 🟑 CSES - Salary Queries
  8. 🟑 CSES - Prefix Sum Queries
  9. 🟒 LC - Range Sum Query - Mutable
  10. 🟒 LC - Count of Smaller Numbers After Self

Number Theory

  1. 🟑 CSES - Exponentiation
  2. 🟑 CSES - Exponentiation II
  3. 🟑 CSES - Counting Divisors
  4. 🟑 CSES - Common Divisors
  5. 🟑 CSES - Divisor Analysis
  6. 🟑 CSES - Prime Multiples
  7. 🟑 CSES - Binomial Coefficients
  8. 🟑 CSES - Creating Strings II
  9. 🟒 LC - Pow(x, n)
  10. πŸ”΅ CF - Count the Arrays

Bit Manipulation

  1. 🟒 LC - Number of 1 Bits
  2. 🟒 LC - Counting Bits
  3. 🟒 LC - Reverse Bits
  4. 🟒 LC - Sum of Two Integers
  5. 🟒 LC - Single Number II
  6. 🟒 LC - Single Number III
  7. 🟑 CSES - Xor Sum
  8. πŸ”΅ CF - Maximum Xor Secondary
  9. 🟒 LC - Subsets (Bitmask)
  10. 🟒 LC - Bitwise AND of Numbers Range

String Algorithms

  1. 🟑 CSES - String Matching
  2. 🟑 CSES - Finding Borders
  3. 🟑 CSES - Finding Periods
  4. 🟑 CSES - Minimal Rotation
  5. 🟒 LC - Longest Happy Prefix
  6. 🟒 LC - Repeated String Match
  7. πŸ”΅ CF - Password
  8. 🟑 CSES - Longest Palindrome
  9. 🟒 LC - Find the Index of the First Occurrence
  10. πŸ”΅ CF - Anthem of Berland

Game Theory

  1. 🟑 CSES - Stick Game
  2. 🟑 CSES - Nim Game I
  3. 🟑 CSES - Nim Game II
  4. 🟑 CSES - Stair Game
  5. 🟑 CSES - Grundy's Game
  6. 🟒 LC - Stone Game IV
  7. πŸ”΅ CF - Marble Match
  8. 🟒 LC - Nim Game
  9. 🟒 LC - Divisor Game
  10. 🟒 LC - Predict the Winner

Phase 6: Expert Level Topics (Problems 446-575)

Focus: Advanced Techniques for 1900+ Rating

Missing AtCoder DP & Advanced DP Optimization

  1. 🟠 AC DP-C - Vacation
  2. 🟑 CSES - Two Sets II
  3. 🟑 CSES - Rectangle Cutting
  4. 🟑 CSES - Edit Distance
  5. 🟑 CSES - Projects
  6. πŸ”΅ CF - Boredom
  7. πŸ”΅ CF - Longest Regular Bracket Sequence
  8. πŸ”΅ CF - Woodcutters
  9. πŸ”΅ CF - Color Stripe
  10. πŸ”΅ CF - Vacations

Constructive Algorithms

  1. πŸ”΅ CF - Make It Equal
  2. πŸ”΅ CF - Constructing the Array
  3. πŸ”΅ CF - Array Stabilization
  4. πŸ”΅ CF - Polycarp and Letters
  5. πŸ”΅ CF - Dreamoon and WiFi
  6. πŸ”΅ CF - Make a Power of Two
  7. πŸ”΅ CF - Strange Partition
  8. πŸ”΅ CF - Array Sharpening
  9. πŸ”΅ CF - Odd Divisor
  10. πŸ”΅ CF - Yet Another Palindrome Problem

Matrix Exponentiation

  1. 🟑 CSES - Fibonacci Numbers
  2. 🟑 CSES - Throwing Dice
  3. 🟑 CSES - Graph Paths I
  4. 🟑 CSES - Graph Paths II
  5. πŸ”΅ CF - Tiles
  6. πŸ”΅ CF - The Number of Inversions
  7. 🟒 LC - Knight Dialer
  8. 🟒 LC - Count Vowels Permutation
  9. πŸ”΅ CF - Xor-Sequences
  10. 🟑 CSES - Bracket Sequences I

Square Root Decomposition & Mo's Algorithm

  1. πŸ”΅ CF - Educational Mo's Algorithm
  2. 🟑 CSES - Distinct Values Queries
  3. πŸ”΅ CF - Powerful Array
  4. πŸ”΅ CF - Xenia and Tree
  5. πŸ”΅ CF - Array Queries
  6. 🟒 LC - Range Frequency Queries
  7. πŸ”΅ CF - Little Elephant and Inversions
  8. 🟑 CSES - Range Queries and Copies
  9. πŸ”΅ CF - Jeff and Removing Periods
  10. 🟒 LC - Count of Range Sum

Advanced String Algorithms

  1. 🟑 CSES - Word Combinations
  2. 🟑 CSES - Pattern Positions
  3. 🟑 CSES - Counting Patterns
  4. 🟑 CSES - Distinct Substrings
  5. πŸ”΅ CF - Z-function Application
  6. πŸ”΅ CF - Prefixes and Suffixes
  7. πŸ”΅ CF - MUH and Cube Walls
  8. πŸ”΅ CF - Suffix Structures
  9. 🟒 LC - Shortest Palindrome
  10. 🟒 LC - Sum of Scores of Built Strings

Heavy-Light Decomposition & Centroid Decomposition

  1. 🟑 CSES - Path Queries
  2. 🟑 CSES - Path Queries II
  3. 🟑 CSES - Subtree Queries
  4. πŸ”΅ CF - Educational HLD
  5. πŸ”΅ CF - Xenia and Tree
  6. πŸ”΅ CF - Fools and Roads
  7. πŸ”΅ CF - Race
  8. 🟑 CSES - Fixed-Length Paths I
  9. 🟑 CSES - Fixed-Length Paths II
  10. πŸ”΅ CF - Centroids

Convex Hull Trick & DP Optimization

  1. πŸ”΅ CF - Covered Points Count
  2. πŸ”΅ CF - Acquire
  3. πŸ”΅ CF - Kalila and Dimna in the Logging Industry
  4. 🟑 CSES - Moving Robots
  5. πŸ”΅ CF - Buy Low Sell High
  6. πŸ”΅ CF - The Child and Sequence
  7. 🟑 CSES - Counting Tilings
  8. πŸ”΅ CF - Knapsack for All Segments
  9. πŸ”΅ CF - Walking Robot
  10. πŸ”΅ CF - Prefix Sum Primes

More Essential CF Problems (Rating 1200-1600)

  1. πŸ”΅ CF - Queue at the School
  2. πŸ”΅ CF - Before an Exam
  3. πŸ”΅ CF - New Year and Hurry
  4. πŸ”΅ CF - Mike and Shortcuts
  5. πŸ”΅ CF - Interesting Array
  6. πŸ”΅ CF - The Labyrinth
  7. πŸ”΅ CF - Points on Line
  8. πŸ”΅ CF - Little Artem and Dance
  9. πŸ”΅ CF - Love "A"
  10. πŸ”΅ CF - Kayaking

Additional Important Patterns

  1. πŸ”΅ CF - Permutation Transformation
  2. πŸ”΅ CF - Binary String Reconstruction
  3. πŸ”΅ CF - Count Subrectangles
  4. πŸ”΅ CF - Almost Identity Permutations
  5. πŸ”΅ CF - Kefa and Company
  6. πŸ”΅ CF - k-Tree
  7. πŸ”΅ CF - Two Buttons
  8. πŸ”΅ CF - New Year's Number
  9. πŸ”΅ CF - Phoenix and Beauty
  10. πŸ”΅ CF - Ball in Berland

Probability & Expected Value

  1. 🟑 CSES - Dice Probability
  2. πŸ”΅ CF - Ilya and Escalator
  3. πŸ”΅ CF - Lucky Probability
  4. 🟒 LC - New 21 Game
  5. 🟒 LC - Soup Servings
  6. πŸ”΅ CF - Two Teams Composing
  7. πŸ”΅ CF - Bad Ugly Numbers
  8. 🟒 LC - Toss Strange Coins
  9. πŸ”΅ CF - Playlist
  10. πŸ”΅ CF - AND 0, Sum Big

Geometry Basics

  1. 🟑 CSES - Point Location Test
  2. 🟑 CSES - Line Segment Intersection
  3. 🟑 CSES - Polygon Area
  4. 🟑 CSES - Point in Polygon
  5. 🟑 CSES - Polygon Lattice Points
  6. 🟑 CSES - Minimum Euclidean Distance
  7. 🟑 CSES - Convex Hull
  8. 🟒 LC - Erect the Fence
  9. πŸ”΅ CF - Geometric Progression
  10. πŸ”΅ CF - Points and Lines

Interactive Problems

  1. πŸ”΅ CF - Guess the Number
  2. πŸ”΅ CF - Guess the Maximums
  3. πŸ”΅ CF - XOR and Favorite Number
  4. πŸ”΅ CF - Interactive Binary Search
  5. πŸ”΅ CF - Tricky Function
  6. πŸ”΅ CF - Guess the K-th Zero
  7. πŸ”΅ CF - Lost Numbers
  8. πŸ”΅ CF - Ehab's TORTURE!
  9. πŸ”΅ CF - Xor Guessing
  10. 🟒 LC - Guess Number Higher or Lower

More CSES Completionist Problems

  1. 🟑 CSES - Apple Division
  2. 🟑 CSES - Creating Strings
  3. 🟑 CSES - Bit Strings
  4. 🟑 CSES - Trailing Zeros
  5. 🟑 CSES - Gray Code
  6. 🟑 CSES - Digit Queries
  7. 🟑 CSES - Palindrome Reorder
  8. 🟑 CSES - Nested Ranges Check
  9. 🟑 CSES - Nested Ranges Count
  10. 🟑 CSES - List Removals

Phase 7: Master Level Topics (Problems 576-655+)

Focus: Advanced Graph Theory, Flow Networks, Advanced Strings, Combinatorics - For 2100+ Rating

Network Flow & Bipartite Matching

  1. 🟑 CSES - Download Speed (Max Flow)
  2. 🟑 CSES - Police Chase (Min Cut)
  3. 🟑 CSES - School Dance (Bipartite Matching)
  4. 🟑 CSES - Coin Grid (Min Vertex Cover)
  5. πŸ”΅ CF - Maximum Flow
  6. πŸ”΅ CF - Bipartite Matching Intro
  7. πŸ”΅ CF - Soldier and Traveling
  8. 🟒 LC - Maximum Flow
  9. πŸ”΅ CF - Cow and Snacks
  10. πŸ”΅ CF - King's Path

Bridges, Articulation Points & 2-SAT

  1. 🟑 CSES - Giant Pizza (2-SAT)
  2. πŸ”΅ CF - Bridges and SCC
  3. πŸ”΅ CF - Roads in Berland
  4. πŸ”΅ CF - President and Roads
  5. πŸ”΅ CF - Tourist
  6. πŸ”΅ CF - Graph Connectivity
  7. 🟒 LC - Critical Connections in a Network
  8. πŸ”΅ CF - Strongly Connected City
  9. πŸ”΅ CF - Learning Languages
  10. πŸ”΅ CF - Party

Fenwick Tree (Binary Indexed Tree)

  1. 🟑 CSES - Inversion Count (BIT)
  2. 🟑 CSES - Dynamic Range Sum (BIT approach)
  3. πŸ”΅ CF - Pashmak and Parmida's problem
  4. πŸ”΅ CF - Little Artem and Matrix
  5. πŸ”΅ CF - Puzzles
  6. 🟒 LC - Count of Smaller Numbers After Self
  7. πŸ”΅ CF - Subsequence Counting
  8. πŸ”΅ CF - K-inversions
  9. πŸ”΅ CF - Subsequences
  10. 🟒 LC - Reverse Pairs

Suffix Array & Advanced String Matching

  1. 🟑 CSES - Substring Order I
  2. 🟑 CSES - Substring Order II
  3. 🟑 CSES - Repeating Substring
  4. πŸ”΅ CF - Prefixes and Suffixes
  5. πŸ”΅ CF - Anthem of Berland
  6. πŸ”΅ CF - Suffix Automaton Intro
  7. πŸ”΅ CF - String Functions
  8. 🟒 LC - Longest Duplicate Substring
  9. πŸ”΅ CF - Aho-Corasick Intro
  10. πŸ”΅ CF - Antimatter

Inclusion-Exclusion & Advanced Combinatorics

  1. 🟑 CSES - Counting Coprime Pairs
  2. 🟑 CSES - Derangements
  3. πŸ”΅ CF - Coprime Triples
  4. πŸ”΅ CF - Sum of Cubes
  5. πŸ”΅ CF - Array Destruction
  6. πŸ”΅ CF - Berserk And Fireball
  7. πŸ”΅ CF - GCD Counting
  8. 🟒 LC - Count Good Triplets in an Array
  9. πŸ”΅ CF - Beautiful Numbers
  10. πŸ”΅ CF - Permutations

Meet-in-the-Middle

  1. 🟑 CSES - Meet in the Middle
  2. 🟒 LC - Partition Array Into Two Arrays to Minimize Sum Difference
  3. πŸ”΅ CF - Balanced Tunnel
  4. πŸ”΅ CF - Rocket
  5. πŸ”΅ CF - Two Sets
  6. πŸ”΅ CF - Maximum Median
  7. πŸ”΅ CF - Number of Simple Paths
  8. πŸ”΅ CF - Ciel and Robot
  9. πŸ”΅ CF - Same Sums
  10. 🟒 LC - 4Sum II

Sparse Table & RMQ Variants

  1. 🟑 CSES - Static Range Minimum Queries
  2. πŸ”΅ CF - Sparse Table Tutorial
  3. πŸ”΅ CF - Ant colony
  4. πŸ”΅ CF - Swaps in Permutation
  5. 🟒 LC - Range Sum Query - Immutable
  6. πŸ”΅ CF - Sereja and Brackets
  7. πŸ”΅ CF - Little Girl and Maximum XOR
  8. πŸ”΅ CF - RMQ Task
  9. πŸ”΅ CF - Strip
  10. πŸ”΅ CF - Alternating Current

Ternary Search & Optimization

  1. πŸ”΅ CF - Burning Midnight Oil
  2. πŸ”΅ CF - Andrey and Escape from Capygrad
  3. πŸ”΅ CF - Three displays
  4. 🟒 LC - Find Peak Element
  5. πŸ”΅ CF - Primes or Palindromes?
  6. πŸ”΅ CF - Worms
  7. πŸ”΅ CF - Consecutive Subsequence
  8. πŸ”΅ CF - Fish
  9. πŸ”΅ CF - Array Elimination
  10. 🟒 LC - Maximum Beauty of an Array After Applying Operation

πŸŽ“ Bonus: Resources for Continued Practice

After Completing This Roadmap

  • CSES Problem Set: Complete all remaining sections
  • AtCoder Educational DP Contest: All 26 problems (A-Z)
  • Codeforces EDU: Binary Search, Segment Tree, DSU courses
  • USACO Guide: Bronze β†’ Silver β†’ Gold β†’ Platinum

Codeforces Tags (by importance)

  1. implementation, greedy, math, constructive
  2. binary search, two pointers, sortings
  3. dp, brute force, data structures
  4. dfs, graphs, trees
  5. number theory, strings, bitmasks

🏁 Final Notes

  1. Consistency > Intensity: 1-2 hours daily beats 10 hours on weekends
  2. Contest Participation: Enter at least 1-2 rated contests per week
  3. Virtual Contests: Do Codeforces virtual contests for practice
  4. Track Progress: Mark problems as solved, note key insights
  5. Don't Rush: It's okay to spend days on hard problems
  6. Plateau is Normal: Rating stalls are expected; keep grinding

Expected Timeline:

  • Phase 0-1: 2-3 months
  • Phase 2-3: 3-4 months
  • Phase 4-5: 4-6 months
  • Phase 6-7: 4-6 months
  • Total: ~18-24 months to Candidate Master (2200+)

πŸ“‹ Topic Checklist (Algorithms Covered)

βœ… Fundamentals: Arrays, Strings, Math, Implementation
βœ… Sorting & Searching: Merge Sort, Quick Sort, Binary Search, Ternary Search
βœ… Two Pointers & Sliding Window: Classic patterns
βœ… Prefix Sums & Difference Arrays: 1D and 2D
βœ… Greedy Algorithms: Interval scheduling, activity selection
βœ… Data Structures: Stack, Queue, Heap, DSU, Trie, Fenwick Tree, Segment Tree, Sparse Table
βœ… Graph Algorithms: BFS, DFS, Dijkstra, Bellman-Ford, Floyd-Warshall, MST (Kruskal/Prim)
βœ… Tree Algorithms: LCA, Binary Lifting, Tree DP, HLD, Centroid Decomposition
βœ… Advanced Graph: Bridges, Articulation Points, SCC, Topological Sort, Eulerian Path
βœ… Network Flow: Max Flow, Min Cut, Bipartite Matching
βœ… Dynamic Programming: All major patterns (Grid, Knapsack, LIS/LCS, Interval, Tree, Bitmask, Digit)
βœ… DP Optimizations: Divide & Conquer DP, Convex Hull Trick, Matrix Exponentiation
βœ… String Algorithms: Hashing, KMP, Z-function, Suffix Array, Manacher's
βœ… Number Theory: GCD, Sieve, Modular Arithmetic, Binomial Coefficients, Euler's Totient
βœ… Combinatorics: Inclusion-Exclusion, Stars and Bars, Catalan Numbers
βœ… Game Theory: Sprague-Grundy, Nim
βœ… Geometry: Convex Hull, Point-in-Polygon, Line Intersection
βœ… Advanced Techniques: Mo's Algorithm, Sqrt Decomposition, Meet-in-Middle
βœ… Interactive Problems: Binary search queries, adaptive strategies
βœ… 2-SAT: Implication graphs, SCC-based solutions

Good luck on your journey! πŸš€

@shamsch
Copy link

shamsch commented Sep 16, 2025

ok thanks a lot bro, love and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment