Competitive Programmer DSA
- 1st Visit
- 0/114
- 2nd Visit
- 0/114
- Revise
- 0/114
01Number Theory
0/14
Number theory problems revolve around divisibility, primes, gcd and lcm, and modular arithmetic. The core tools are the Euclidean algorithm, a sieve of Eratosthenes or…
Pattern guide02Combinatorics & Modular Arithmetic
0/12
Counting problems ask for the number of arrangements, sequences or selections, usually modulo a prime such as 1e9+7 or 998244353. Precompute factorials and inverse…
Pattern guide03Constructive Algorithms
0/15
Constructive problems ask you to build any valid object, such as a permutation, an array, a string or a sequence of operations, rather than compute a single number…
Pattern guide04Segment Tree & Fenwick Tree
0/13
Range query structures answer questions about subarrays while the array keeps changing. A Fenwick tree, or binary indexed tree, supports point updates and prefix sums…
Pattern guide05Advanced DP (Bitmask, Digit, Interval)
0/15
Some DP states do not fit a simple index. Bitmask DP encodes a subset of up to about 20 items in an integer, as in dp[mask][last] for ordering or assignment problems…
Pattern guide06Graph Theory (MST, SCC, Bridges)
0/13
This pattern covers graph algorithms beyond traversal. A minimum spanning tree connects every vertex at the least total cost: Kruskal sorts the edges and joins…
Pattern guide07String Algorithms (KMP, Z, Hashing)
0/11
Linear time string matching avoids the O(nm) cost of comparing a pattern at every position. The prefix function from KMP gives, for each prefix, the length of its…
Pattern guide08Game Theory
0/9
In an impartial game both players have the same moves, and under normal play the player who cannot move loses. Classify positions backwards: a position is winning if…
Pattern guide| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | Stone Game III | LeetCode | Hard | Solve Stone Game III on LeetCode (opens in a new tab) | |||
| 2 | 1-2-K Game | Codeforces | Medium 1700 | Solve 1-2-K Game on Codeforces (opens in a new tab) | |||
| 3 | Stoned Game | Codeforces | Hard 1800 | Solve Stoned Game on Codeforces (opens in a new tab) | |||
| 4 | A Lot of Games | Codeforces | Hard 1900 | Solve A Lot of Games on Codeforces (opens in a new tab) | |||
| 5 | GameGame | Codeforces | Hard 1900 | Solve GameGame on Codeforces (opens in a new tab) | |||
| 6 | Tree Tag | Codeforces | Hard 1900 | Solve Tree Tag on Codeforces (opens in a new tab) | |||
| 7 | Cat and Mouse | LeetCode | Hard | Solve Cat and Mouse on LeetCode (opens in a new tab) | |||
| 8 | Not a Nim Problem | Codeforces | Hard 2100 | Solve Not a Nim Problem on Codeforces (opens in a new tab) | |||
| 9 | Lieges of Legendre | Codeforces | Hard 2200 | Solve Lieges of Legendre on Codeforces (opens in a new tab) |
09Mixed Practice
All patterns0/12
This set mixes problems from the Competitive Programmer patterns, and the pattern label is deliberately hidden. In a contest the hardest step is often deciding which…
Pattern guide