HOME / CATALOG / COMPETITIVE PROGRAMMING
01
ROADMAP / INTERMEDIATE

Competitive Programming

40 TOPICS · 50 HOURS · INTERMEDIATE · SCALE 1:4
START CANVAS

A structured roadmap from programming fundamentals to advanced algorithmic problem-solving, covering data structures, algorithms, mathematical techniques, and contest strategies used in competitions like ICPC, Codeforces, and IOI.


§ SYLLABUS

§ SECTION 01 · FOUNDATIONS
  1. 01
    Language Mastery & Fast I/O

    Choose a competition language (C++ recommended), master its STL, and learn fast input/output techniques to avoid TLE on large inputs.

  2. 02
    Brute Force & Complete Search

    Learn to enumerate all possible solutions systematically. Understand when brute force is viable and how to prune the search space.

  3. 03
    Greedy Algorithms

    Understand the greedy paradigm: making locally optimal choices and proving they lead to globally optimal solutions via exchange arguments.

  4. 04
    Foundations Complete

    You can solve ad-hoc and implementation problems, use greedy reasoning, and handle I/O efficiently.

§ SECTION 02 · COMPLEXITY ANALYSIS
  1. 01
    Time & Space Complexity

    Analyze algorithms using Big-O notation. Learn to estimate whether a solution will pass within time and memory limits before coding it.

  2. 02
    Amortized Analysis

    Understand how to analyze sequences of operations where individual steps may be expensive but the average cost is low, such as dynamic arrays and union-find.

§ SECTION 03 · ESSENTIAL DATA STRUCTURES
  1. 01
    Arrays, Stacks & Queues

    Master linear data structures, their operations, and classic applications like matching parentheses, next-greater-element, and sliding window problems.

  2. 02
    Sets, Maps & Hash Tables

    Use balanced BSTs and hash maps for fast lookup, counting, and coordinate compression. Understand when to choose ordered vs unordered containers.

  3. 03
    Priority Queues & Heaps

    Learn heap operations and applications: Dijkstra's algorithm, event simulation, greedy scheduling, and the k-th element pattern.

  4. 04
    Disjoint Set Union (Union-Find)

    Implement DSU with path compression and union by rank. Apply it to connectivity queries, Kruskal's MST, and online graph problems.

  5. 05
    Data Structures Solid

    You can choose the right data structure for a problem and implement it correctly under time pressure.

§ SECTION 04 · SEARCHING & SORTING
  1. 01
    Binary Search

    Apply binary search on sorted data and on the answer space. Recognize monotonic predicates and use binary search to optimize brute-force solutions.

  2. 02
    Sorting Techniques & Applications

    Use sorting as a preprocessing step. Learn merge sort for inversion counting, custom comparators, and coordinate compression via sorting.

  3. 03
    Two Pointers & Sliding Window

    Solve subarray and subsequence problems in linear time by maintaining two pointers or a sliding window over sorted or sequential data.

§ SECTION 05 · DYNAMIC PROGRAMMING
  1. 01
    Introduction to DP

    Understand memoization vs tabulation, identify overlapping subproblems and optimal substructure, and solve classic problems like Fibonacci, knapsack, and LCS.

  2. 02
    Classical DP Patterns

    Master common DP patterns: interval DP, digit DP, bitmask DP, and DP on subsets. Learn to define states and transitions for each pattern.

  3. 03
    DP Optimization Techniques

    Speed up DP using divide-and-conquer optimization, Knuth's optimization, convex hull trick, and the SMAWK algorithm for specific recurrence structures.

  4. 04
    DP Proficient

    You can model most problems as DP, identify the right state representation, and optimize transitions when needed.

§ SECTION 06 · GRAPH ALGORITHMS
  1. 01
    Graph Representation, BFS & DFS

    Represent graphs with adjacency lists. Implement BFS for shortest paths in unweighted graphs and DFS for cycle detection, topological sorting, and connected components.

  2. 02
    Shortest Path Algorithms

    Implement Dijkstra, Bellman-Ford, and Floyd-Warshall. Know when to use each based on graph properties (negative weights, all-pairs, sparse vs dense).

  3. 03
    Minimum Spanning Trees

    Find MSTs using Kruskal's (with DSU) and Prim's algorithms. Understand applications and properties like the cut and cycle properties.

  4. 04
    Tree Algorithms

    Solve problems on trees: diameter, LCA (binary lifting), Euler tour, subtree queries, and rerooting technique for tree DP.

  5. 05
    Network Flow & Matching

    Implement max-flow algorithms (Ford-Fulkerson, Dinic's) and understand min-cut duality. Apply to bipartite matching and assignment problems.

  6. 06
    Graph Algorithms Complete

    You can model real problems as graphs and apply the right traversal, shortest-path, or flow algorithm.

§ SECTION 07 · MATHEMATICS & NUMBER THEORY
  1. 01
    Modular Arithmetic

    Perform arithmetic under a modulus: fast exponentiation, modular inverse, and handling large numbers that require mod 10^9+7.

  2. 02
    Primes & Sieve of Eratosthenes

    Generate primes efficiently, factorize numbers, and apply prime-related techniques like Euler's totient function and divisor enumeration.

  3. 03
    Combinatorics & Counting

    Compute combinations, permutations, and Catalan numbers. Apply inclusion-exclusion and the pigeonhole principle to counting problems.

  4. 04
    Game Theory (Sprague-Grundy)

    Analyze combinatorial games using Grundy numbers and the Sprague-Grundy theorem. Solve Nim variants and impartial games.

§ SECTION 08 · STRING ALGORITHMS
  1. 01
    String Hashing

    Use polynomial rolling hashes for fast substring comparison. Handle collision avoidance with double hashing and apply to pattern matching and palindrome detection.

  2. 02
    KMP & Z-Algorithm

    Find pattern occurrences in linear time using prefix functions (KMP) or Z-arrays. Understand failure function construction and applications.

  3. 03
    Tries

    Build prefix trees for efficient string lookups, autocomplete, and XOR-maximum queries. Extend to persistent tries when needed.

  4. 04
    Suffix Arrays & Automata

    Construct suffix arrays in O(n log n) and use LCP arrays for substring problems. Understand suffix automata for advanced string tasks.

§ SECTION 09 · ADVANCED TECHNIQUES
  1. 01
    Segment Trees

    Build segment trees for range queries and point/range updates. Master lazy propagation and apply to problems like range sum, min, max, and GCD.

  2. 02
    Binary Indexed Tree (Fenwick Tree)

    Use BIT for prefix sum queries and point updates in O(log n). Understand its simplicity advantage over segment trees for certain problems.

  3. 03
    Square Root Decomposition & Mo's Algorithm

    Divide data into blocks of size √n for offline range queries. Apply Mo's algorithm to answer range queries without updates efficiently.

  4. 04
    Computational Geometry

    Implement point, line, and polygon operations. Solve convex hull, line intersection, and closest pair problems with robust floating-point handling.

  5. 05
    Advanced Techniques Mastered

    You can handle hard competition problems requiring advanced data structures, string algorithms, and mathematical reasoning.

§ SECTION 10 · CONTEST STRATEGY
  1. 01
    Problem-Solving Strategies

    Develop a systematic approach: read carefully, identify problem type, consider edge cases, estimate complexity, and choose the right technique before coding.

  2. 02
    Debugging & Stress Testing

    Write brute-force solutions and random test generators to find bugs via stress testing. Learn to debug efficiently under time pressure.

  3. 03
    Contest Ready

    You have the algorithmic toolkit and practical skills to compete effectively in Codeforces Div 2, ICPC regionals, and similar competitions.