Skip to main content

Competitive Programming Mastery

CP Mastery Path
This isn’t just another algorithms course. This is a strategic battle plan to take you from solving Div2A problems to crushing Div1 and qualifying for ICPC World Finals. Every chapter is designed with one goal: make you win.
Course Goal: Take you from Newbie (800) to Expert (1600+) on Codeforces and prepare you for ICPC Regionals within 6-12 months of dedicated practice.

The Winning Formula

Most people practice CP wrong. They solve random problems, never upsolve, and wonder why they plateau. Here’s the formula that actually works:
Rating Growth = Pattern Recognition × Problem Quantity × Upsolving × (1 / Random Solving)

Pattern Recognition

80% of CF problems use just 15 core patterns. Master them and you’ll “see” solutions instantly.

Strategic Practice

Solve problems slightly above your level. Use CP-31, Codeforces Problemset filters, and A2OJ ladders.

Upsolving is Everything

Every problem you couldn’t solve in contest is a lesson. Upsolve within 24 hours or you wasted the contest.

Speed + Accuracy

In ICPC, more problems solved always wins. But when tied, lower penalty time breaks it—so speed matters.

The Strategic Approach

The “See the Pattern” Framework

When you read a problem, run through this mental checklist:
1

Constraints Analysis (30 seconds)

  • n ≤ 20 → Bitmask DP / Brute force
  • n ≤ 10³ → O(n²) solutions
  • n ≤ 10⁵ → O(n log n) or O(n)
  • n ≤ 10⁶ → O(n) only
2

Problem Type Recognition (1 minute)

  • “Minimum/Maximum” → DP, Greedy, or Binary Search on Answer
  • “Count ways” → DP or Combinatorics
  • “Yes/No possible” → Greedy, Graph connectivity, or Binary Search
  • “Shortest path” → BFS/Dijkstra
  • “Subarray/Substring” → Two Pointers, Sliding Window, or Prefix Sum
3

Pattern Matching (2-3 minutes)

Match to known patterns. If stuck, think: “What’s the simplest version of this problem I can solve?”
4

Edge Cases (Before Coding)

n=1, n=2, all same elements, all different, sorted, reverse sorted, negative numbers.

What Makes This Course Different

Real CF Problems

Every topic has 10+ curated Codeforces problems with difficulty ratings.

Pattern Recognition

We teach you HOW to identify patterns, not just what the patterns are.

Common Mistakes

Every chapter covers the mistakes that cause WA/TLE so you avoid them.

Mental Models

Analogies and visualizations to build intuition, not just memorization.

CP-31 Integration

References to the famous CP-31 sheet for structured practice.

Contest Strategy

Not just algorithms—how to approach a 2-hour contest optimally.

Course Structure: The Rating Ladder

Phase 1: Foundation (Newbie → Pupil: 800-1200)

ChapterTopicKey PatternsTarget Problems
1Time ComplexityConstraint analysis-
2Fast I/O & TemplatesSpeed optimization-
3STL MasteryChoosing right data structure-
4Prefix SumRange queriesCF 800-1100
5Two PointersSorted arrays, subarraysCF 800-1200

Phase 2: Core Techniques (Pupil → Specialist: 1200-1400)

ChapterTopicKey PatternsTarget Problems
6Binary SearchSearch on answer, boundsCF 1100-1400
7Sorting StrategiesCustom comparatorsCF 1100-1300
8Recursion & BacktrackingSubsets, permutationsCF 1200-1400
9Greedy AlgorithmsExchange argumentsCF 1200-1500
10Divide & ConquerMerge sort patternCF 1300-1500

Phase 3: Dynamic Programming (Specialist → Expert: 1400-1600)

ChapterTopicKey PatternsTarget Problems
11DP Fundamentals1D DP, state designCF 1300-1600
12DP on Grids & Advanced2D DP, bitmask DPCF 1400-1700

Phase 4: Graphs (Expert Level: 1500-1700)

ChapterTopicKey PatternsTarget Problems
13Graph FundamentalsDFS, BFS, cyclesCF 1300-1600
14Shortest PathsDijkstra, FloydCF 1400-1700
15TreesLCA, tree DPCF 1500-1800

Phase 5: Advanced (Expert → Candidate Master: 1600-1900)

ChapterTopicKey PatternsTarget Problems
16Disjoint Set UnionConnectivity, MSTCF 1400-1700
17Segment TreesRange queries with updatesCF 1500-1900
18String AlgorithmsHashing, KMP, Z-functionCF 1500-1800
19Bit ManipulationXOR tricks, bitmaskCF 1400-1700
20Contest StrategyICPC & CF optimization-

The CP-31 Integration

CP-31 is a famous curated problem set that covers all essential topics. Throughout this course, we reference CP-31 problems that align with each chapter:
CP-31 TopicOur ChapterProblems
Implementation1-3Foundation
Prefix Sums4Range queries
Two Pointers5Subarray problems
Binary Search6Search on answer
Greedy9Optimization
DP11-12All DP patterns
Graphs13-15Traversals, paths, trees
Data Structures16-17DSU, Segment Tree
Strings18Pattern matching

Practice Resources

Essential Tools & Extensions

ToolPurposeLink
Competitive CompanionParse problems to IDEChrome
CF-PredictorPredict rating changesChrome Extension
CarrotRating predictor (alternate)Chrome
CPH (VS Code)Auto testing in VS CodeVS Code Extension
A2OJ LaddersRating-based problem listsA2OJ
CF VisualizerAnalyze your statscfviz

CSES 300

Complete the entire CSES problemset. Covers all fundamentals.

Striver's CP Sheet

450 curated problems for placement prep.

Junior Training Sheet

500 problems from 800 to 1600 rating.

The Mindset of Champions

Reading ≠ Learning. Solving ≠ Understanding.The only way to improve is:
  1. Struggle with problems (at least 30-60 minutes before hints)
  2. Upsolve everything you couldn’t solve
  3. Analyze why you got stuck
  4. Repeat patterns until they’re automatic
DayActivity
Mon-WedSolve 3-5 problems/day from current topic
ThuVirtual contest (past Div2)
FriUpsolve Thursday’s contest
SatLive Codeforces contest
SunUpsolve + Review mistakes

Let’s Begin Your Journey

ResourceDescription
Upsolving GuideHow to learn from every problem
Debugging GuideFind bugs faster with systematic debugging
CF Problem TypesRecognize common CF problem patterns
Code LibraryReady-to-use algorithm implementations
Quick ReferenceOne-page cheat sheet for contests