Build Kit¶
Use this page when the algorithm is mostly known and the bottleneck is now:
- implementing it cleanly
- reopening the right snippet quickly
- checking one invariant under pressure
- stabilizing a suspicious solution locally
This is the repo's retrieve and execute layer.
Quick Split¶
Notebook= recall the invariant, signal, or trapTemplate Library= retrieve the smallest reusable snippetBuild Kit= choose between notebook, templates, and workflow pages
What Lives Here¶
| Need | Best door |
|---|---|
| reusable contest code | Template Library |
| short invariant/trap reminders | Notebook |
| debug a suspicious implementation | Stress testing workflow |
| harden a hack-sensitive or many-answer solution before trusting it | Anti-Hack Workflow |
| interactive or simulator-style local loop | Local judge workflow |
| many-valid-answers task and the legality contract still feels fuzzy | Many-Valid-Answers / Validator-First Workflow |
| predicate-checked batch output or custom-judge legality | Special Judge / Output Protocol Workflow |
| before-contest checklist | Contest checklist |
Exact Starter Routes¶
Use these when the topic is already mostly trusted and you want the shortest path back to code plus one concrete compare target.
| Need | Learn / check first | Reuse | Compare against |
|---|---|---|---|
| point updates plus prefix/range sums | Fenwick hot sheet | fenwick-point-prefix.cpp | CVP00001 |
| merge-only connectivity or Kruskal-style components | DSU hot sheet | dsu-basic.cpp | C11XU |
| offline connectivity under an add/remove edge timeline | DSU Rollback hot sheet | dsu-rollback-dynamic-connectivity.cpp | Dynamic Connectivity |
| every node needs one subtree answer from merged child containers | DSU On Tree hot sheet | small-to-large-subtree-merge.cpp | Distinct Colors |
| one versioned array with point assignment and old-version range sums | Persistent Data Structures hot sheet | persistent-segment-tree-point-set-sum.cpp | Range Queries and Copies |
one branching list/sequence where merge, head, or tail create new roots while old roots stay alive |
Persistent Treap hot sheet | persistent-treap-list-sum.cpp | Persistent List |
one self-hosted ordered set with split/merge by key, online rank, or k-th queries |
Treap / Implicit Treap hot sheet | treap-key-ordered-set.cpp | Salary Queries |
| one mutable sequence with cut/paste, insert/erase by position, or split/merge sequence surgery | Treap / Implicit Treap hot sheet | implicit-treap-sequence.cpp | Cut and Paste |
one static array with subarray k-th / count <= x / count == x queries |
Wavelet Tree hot sheet | wavelet-tree.cpp | MKTHNUM - K-th Number |
| one static array with many range queries where add/remove at one endpoint is cheap | Mo's hot sheet | mos-algorithm.cpp | Powerful Array |
| one live multiset of integers with insert / erase / max xor queries | Binary Trie hot sheet | binary-trie-xor.cpp | Vasiliy's Multiset |
one dynamic ordered set with online rank / k-th / count-smaller queries |
Order Statistics Tree hot sheet | pbds-ordered-set.cpp | ORDERSET - Order Statistic Set |
| one high-fanout textbook ordered dictionary where search + insert + split-full-child are the real lesson | B-Tree hot sheet | b-tree-insert-search.cpp | B-Tree Dictionary |
one probabilistic textbook ordered dictionary where forward-pointer towers and update[] splicing are the real lesson |
Skiplist hot sheet | skiplist-ordered-set.cpp | Skiplist Dictionary |
| one bounded-universe integer set where predecessor / successor through prefix hashing is the real lesson | X-Fast / Y-Fast hot sheet | x-fast-trie.cpp | X-Fast Dictionary |
| one live set of half-open intervals with online insert / erase / any-overlap queries | Interval Tree hot sheet | interval-tree-overlap-treap.cpp | Reservation System |
one self-adjusting ordered multiset where you explicitly want rotate / splay / parent machinery or a direct bridge into link-cut tree |
Splay Tree hot sheet | splay-tree-ordered-set.cpp | Ordinary Balanced Tree |
many singleton heaps that must meld online and answer delete-min by the heap containing x |
Pairing / Leftist Heap hot sheet | leftist-heap-meldable-pq.cpp | Mergeable Heap 1 |
| one interval partition of constant values where range assign keeps collapsing runs and range walks are acceptable | ODT / Chtholly hot sheet | odt-interval-set.cpp | Willem, Chtholly and Seniorious |
| static range minimum on immutable data | Sparse Table hot sheet | sparse-table-rmq.cpp | Static Range Minimum Queries |
| online range add plus range sum on one array | Lazy Segment Tree hot sheet | segment-tree-lazy-range-add-sum.cpp | HORRIBLE |
online range chmin / chmax / add / sum on one array |
Segment Tree Beats hot sheet | segment-tree-beats.cpp | Range Chmin Chmax Add Range Sum |
| one full mask cube where every mask needs all-submask or all-superset aggregates | SOS DP hot sheet | sos-dp-zeta.cpp | Compatible Numbers |
| two full mask functions combine by xor, or one stronger boolean-cube transform family opens after plain SOS sweeps stop fitting | FWHT / XOR Convolution / Subset Convolution hot sheet | fwht-xor-convolution.cpp | Bitwise XOR Convolution |
| one large boolean reachability row where packed shift-OR replaces scalar subset-sum DP | Bit-Parallelism / Bitset Optimization hot sheet | bitset-reachability-shift.cpp | School Excursion |
| merge one or many congruences into one residue modulo lcm | Chinese Remainder hot sheet | chinese-remainder.cpp | General Chinese Remainder |
recover the minimum exponent from a^x ≡ b (mod m) with contest-sized square-root storage |
Discrete Log hot sheet | discrete-log-bsgs.cpp | Discrete Logarithm Mod |
recover one modular square root x^2 ≡ a (mod p) under one prime modulus |
Modular Square Root hot sheet | mod-sqrt-tonelli-shanks.cpp | Sqrt Mod |
find one primitive root modulo one prime once factoring p-1 is already affordable |
Primitive Root hot sheet | primitive-root-prime.cpp | Primitive Root |
| factor one 64-bit integer into sorted prime factors | Pollard-Rho hot sheet | pollard-rho-factorize.cpp | Factorize |
| solve one linear system modulo one prime and recover any valid assignment | Gaussian Elimination hot sheet | gaussian-elimination-mod-prime.cpp | System of Linear Equations |
large nCk mod p with one small prime modulus |
Lucas Theorem hot sheet | lucas-binomial.cpp | Binomial Coefficient (Prime Mod) |
gcd-1 pair counts or divisor-side inclusion-exclusion over all d <= MAX |
Mobius hot sheet | mobius-linear-sieve.cpp | Counting Coprime Pairs |
one summatory divisor-function prefix sum opened through sigma = 1 * id and equal floor(n / d) quotient blocks |
Dirichlet prefix sums hot sheet | dirichlet-convolution-sigma-sum.cpp | Sum of Divisors |
one huge prefix sum of phi or mu recovered implicitly on the quotient set Q_n |
Min_25 / Du Jiao hot sheet | du-jiao-prefix-phi-mu.cpp | Sum of Totient Function |
| one fixed-order linear recurrence or repeated linear transition under modulo | Linear Recurrence hot sheet | matrix-exponentiation.cpp | Throwing Dice |
| one linear recurrence with moderate order, or enough prefix terms to recover that recurrence first | Berlekamp-Massey / Kitamasa hot sheet | berlekamp-massey-kitamasa.cpp | K-th Term of Linearly Recurrent Sequence |
| subset xor span, representability, or maximum subset xor over any subset of inserted numbers | XOR Basis hot sheet | xor-basis.cpp | XMAX - XOR Maximization |
| independent heaps/components under one fixed impartial move set, combined by xor of Grundy values | Sprague-Grundy hot sheet | sprague-grundy-subtract-set.cpp | S-Nim |
| repeated discrete random steps with bounded sum/state and an exact probability query | Probability hot sheet | probability-distribution-dp.cpp | Dice Probability |
one truncated FPS inverse A^{-1} mod x^n under 998244353 after the NTT layer is already trusted |
Polynomial / FPS hot sheet | fps-inv-newton.cpp | Inv of Formal Power Series |
| one-key monotone offline sweep | Offline Tricks hot sheet | offline-query-skeleton.cpp | Distinct Values Queries |
| critical roads or cities in one static undirected graph | Low-Link hot sheet | bridges-articulation-lowlink.cpp | Necessary Roads |
| one static graph walk that must use every edge exactly once | Eulerian hot sheet | eulerian-path-cycle.cpp | Mail Delivery |
one binary order-n string that must contain every length-n bitstring exactly once |
De Bruijn Sequence hot sheet | de-bruijn-sequence-binary.cpp | De Bruijn Sequence |
| one valid boolean assignment under binary clauses | Two-SAT hot sheet | two-sat.cpp | Giant Pizza |
| two rooted trees have unordered children and only shape equality matters | Tree Isomorphism hot sheet | tree-isomorphism-rooted.cpp | Tree Isomorphism I |
| one rooted subtree sum with point updates | Subtree Queries hot sheet | euler-tour-subtree.cpp | Subtree Queries |
| one static rooted tree query that only touches a small marked subset plus the LCAs that glue it together | Virtual Tree hot sheet | virtual-tree.cpp | Kingdom and its Cities |
| bipartite maximum matching with explicit pairs | Matching hot sheet | hopcroft-karp.cpp | School Dance |
| two equal-sized sides with strict full preference lists and a no-blocking-pair objective | Stable Marriage hot sheet | gale-shapley-stable-marriage.cpp | Stable Marriage |
| dense square weighted assignment with one row-column pair each | Hungarian hot sheet | hungarian-assignment.cpp | Task Assignment |
| non-bipartite maximum matching on one undirected graph | General Matching hot sheet | edmonds-blossom.cpp | General Matching |
| plain directed max flow where you want a highest-label preflow sibling instead of the default Dinic route | Push-Relabel hot sheet | push-relabel-max-flow.cpp | Maximum Flow |
| one undirected weighted graph with no designated source/sink, asking only for the cheapest disconnection cut | Global Min-Cut hot sheet | stoer-wagner-global-mincut.cpp | Minimum Cut |
| one undirected weighted graph needs many pairwise min-cuts, to be compressed into one cut tree first | Gomory-Hu hot sheet | gomory-hu-tree.cpp | MCQUERY |
centroid tree structure or one O(log n) centroid-ancestor chain per node |
Centroid hot sheet | centroid-decomposition.cpp | Ciel the Commander |
dynamic forest with online link / cut, vertex adds, and path sums |
Link-Cut Tree hot sheet | link-cut-tree-path-sum.cpp | Dynamic Tree Vertex Add Path Sum |
dynamic forest with online link / cut, vertex adds, and subtree-side sums on one existing edge |
Euler Tour Tree hot sheet | euler-tour-tree-subtree-sum.cpp | Dynamic Tree Vertex Add Subtree Sum |
| exact one-pattern matching | KMP | kmp.cpp | String Matching |
| one static string, longest palindrome, or all center radii | Palindromes hot sheet | manacher.cpp | Longest Palindrome |
| one growing lowercase string, distinct palindromes, or longest palindromic suffix | Eertree hot sheet | eertree.cpp | Distinct Palindromic Substrings |
| many lowercase patterns against one text | Aho-Corasick hot sheet | aho-corasick.cpp | Finding Patterns |
one small regex language with (), |, *, ., and exact full-string membership |
Regex / Finite Automata hot sheet | regex-thompson-nfa.cpp | Regex Membership |
| one optimal binary prefix-code tree from positive symbol frequencies | Huffman / Data Compression hot sheet | huffman-coding.cpp | Huffman Coding Benchmark |
| one static text used as a compressed substring index for existence or earliest-occurrence queries | Suffix Tree hot sheet | suffix-tree.cpp | Pattern Positions |
| exact suffix order plus LCP | Suffix Array / LCP hot sheet | suffix-array.cpp | Repeating Substring |
| one bounded feasible polygon from many directed line constraints | Half-Plane Intersection hot sheet | half-plane-intersection.cpp | Big Brother |
one convex polygon built from all sums a + b of two CCW convex polygons |
Minkowski Sum hot sheet | minkowski-sum-convex.cpp | Mogohu-Rea Idol (stretch) |
| one global nearest Euclidean pair in one static point set | Nearest Pair hot sheet | closest-pair-sweep.cpp | Closest Pair |
| static tree, point updates, path maximum | HLD hot sheet | hld-path-max.cpp | Path Queries II |
| all-roots sum of distances on a tree | Tree DP | tree-dp-rerooting.cpp | Tree Distances II |
| feasible circulation with lower / upper edge bounds | Flow With Lower Bounds hot sheet | flow-lower-bounds.cpp | Reactor Cooling |
| fixed-value costed flow with nonnegative initial forward costs | Min-Cost Flow hot sheet | min-cost-flow.cpp | MINCOST |
| decimal range counting with a small digit state | Digit DP hot sheet | digit-dp-skeleton.cpp | Counting Numbers |
| small-width grid domino tilings where the frontier is an occupancy mask | Broken Profile hot sheet | broken-profile-domino-tiling.cpp | Counting Tilings |
| partition DP row with monotone best split points and cheap interval cost | Divide and Conquer DP hot sheet | divide-and-conquer-dp.cpp | Ciel and Gondolas |
| split-point interval DP with additive interval cost and monotone opt windows | Knuth Optimization hot sheet | knuth-optimization.cpp | Knuth Division |
| online add-line / query-min on arbitrary integer x with full-domain lines | CHT / Li Chao hot sheet | line-container.cpp | Line Add Get Min |
| affine DP with online line insertion on one known integer x-domain | CHT / Li Chao hot sheet | li-chao-tree.cpp | Monster Game II |
exact-K non-adjacent weighted picks where one integer penalty per pick removes the expensive count dimension |
Aliens Trick hot sheet | aliens-trick-nonadjacent-max.cpp | Red and Blue Lamps |
| convex piecewise-linear DP on one integer coordinate with hinge penalties or bounded argmin shifts | Slope Trick hot sheet | slope-trick-basic.cpp | Snuketoon |
| one repeated buy-vs-rent decision where the future horizon is hidden and the whole lesson is competitive ratio against offline OPT | Online Algorithms hot sheet | ski-rental-threshold.cpp | Ski Rental |
| one smooth differentiable loss where the whole lesson is batch gradient descent on one affine predictor | Gradient Descent hot sheet | gradient-descent-linear-regression-1d.cpp | Linear Regression Gradient Descent Benchmark |
| one linearly separable binary classifier where the lesson is the perceptron update rule rather than statistical tooling | Machine Learning hot sheet | perceptron-linear-separable.cpp | Perceptron Classification Benchmark |
| one Boolean oracle promised constant or balanced where the whole lesson is the Deutsch-Jozsa amplitude test in a classical simulator | Quantum Algorithms hot sheet | deutsch-jozsa-simulator.cpp | Deutsch-Jozsa Oracle Benchmark |
one additive scan benchmark where the whole lesson is the Blelloch up-sweep / down-sweep tree plus work / span reasoning |
Parallel Algorithms hot sheet | blelloch-exclusive-scan.cpp | Parallel Prefix Sum Benchmark |
one small continuous LP already normalized to maximize c^T x, Ax <= b, x >= 0 |
Simplex hot sheet | simplex-max-ax-le-b.cpp | Cheese, If You Please |
| one explicit ground set with two independence oracles and a maximum-cardinality common independent set | Matroid Intersection hot sheet | matroid-intersection-oracle.cpp | Pick Your Own Nim |
subset-like exact search with n around 35 to 45 and one cheap merge over half summaries |
Meet-In-The-Middle hot sheet | meet-in-the-middle-subset-sum.cpp | Meet in the Middle |
| first smaller / greater boundary in one linear scan | Monotonic Stack / Queue hot sheet | monotonic-stack-nearest-smaller.cpp | Nearest Smaller Values |
| fixed-size window minimum on a forward-only stream | Monotonic Stack / Queue hot sheet | monotonic-deque-min.cpp | Sliding Window Minimum |
| same-length substring fingerprints | String Hashing hot sheet | rolling-hash.cpp | Finding Borders |
exact convolution modulo 998244353 |
FFT / NTT | ntt.cpp | Convolution |
| cyclic symmetry counting on one necklace under a fixed prime modulus | Burnside / Pólya hot sheet | burnside-cyclic-necklaces.cpp | Counting Necklaces |
one Bézout witness, or one inverse under composite modulus / ax + by = c |
Modular Arithmetic hot sheet | extended-gcd-diophantine.cpp | Euclid Problem |
Choose The Smallest Useful Tool¶
Template Library¶
Open Template Library when:
- you already know the family
- you want the smallest contest-ready implementation
- you need one fast chooser table, not a tutorial
- you already have a topic page or note anchor and now need the smallest reusable code shape
Do not open it first if you still do not trust the topic itself.
Notebook¶
Open Notebook when:
- you mostly know the idea
- you need the main invariant, trap, or signal fast
- you want the shortest route back to the right family
Do not use it as first exposure.
Workflows¶
Open a workflow page when the algorithm feels right but the solution still feels unsafe:
Build Kit Routes¶
| If the problem feels like... | Open first | Then |
|---|---|---|
| “I know the topic, just give me the snippet” | Template Library | the relevant topic page only if trust is low |
| “I know the topic, but I forgot the invariant” | Notebook | the relevant template |
| “The code compiles, but I do not trust it” | Stress testing workflow | the relevant note or template |
| “The idea seems right, but a hack or rejudge could still break it” | Anti-Hack Workflow | Stress testing workflow or Local judge workflow |
| “This task has a judge/protocol quirk” | Local judge workflow | the relevant playbook or note |
| “I know the idea, but interactive tasks keep leaking to flush / budget / transcript discipline” | Interactive Protocol Clinic 01 | Local judge workflow |
| “This task allows many legal outputs, and I still cannot state the exact legality contract” | Many-Valid-Answers / Validator-First Workflow | Special Judge / Output Protocol Workflow |
| “The model seems right, but numeric output, tolerance, or formatting still feels brittle” | Precision / Formatting Robustness Clinic 01 | Foundations cheatsheet or the relevant note |
| “This batch task is checked by a predicate, validator, or score-aware output rule” | Special Judge / Output Protocol Workflow | Local judge workflow or the relevant clinic |
| “This is an open-ended score-based task with no single clear optimum, and I need the right operating model first” | Heuristic / Marathon Intro | Algorithm Engineering |
Best Pairings¶
- Fenwick / dynamic prefix counts -> Fenwick hot sheet + data-structures templates
- merge-only connectivity -> DSU hot sheet + graph/data-structure templates
- offline add/remove connectivity -> DSU Rollback hot sheet + Offline Tricks hot sheet
- subtree container merging with one answer per node -> DSU On Tree hot sheet + Data structures cheatsheet
- static current-range maintenance -> Mo's hot sheet + Offline Tricks hot sheet
- full-domain online line minimum without declaring the x-domain -> CHT / Li Chao hot sheet + DP templates
- versioned array queries over old snapshots -> Persistent Data Structures hot sheet + Segment Tree hot sheet
- versioned split/merge list surgery over old roots -> Persistent Treap hot sheet + Treap / Implicit Treap hot sheet
- self-hosted ordered set with split/merge by key or PBDS-free rank /
k-th -> Treap / Implicit Treap hot sheet + Order Statistics Tree hot sheet - first-smaller / first-greater boundary scans or fixed-width window extrema -> Monotonic Stack / Queue hot sheet + Data structures cheatsheet
- explicit B-tree breadth / high-fanout node splitting -> B-Tree hot sheet + Balanced BST hot sheet
- explicit skiplist breadth / probabilistic forward-pointer towers -> Skiplist hot sheet + Balanced BST hot sheet
- bounded-universe predecessor / successor breadth -> X-Fast / Y-Fast hot sheet + Binary Trie hot sheet
- live interval overlap queries over one explicit interval set -> Interval Tree hot sheet + Balanced BST hot sheet
- self-adjusting ordered set or explicit rotate/splay preparation for dynamic trees -> Splay Tree hot sheet + Link-Cut Tree hot sheet
- mutable sequence edits by position -> Treap / Implicit Treap hot sheet + Lazy Segment Tree hot sheet
- static subarray order statistics or threshold counts by value -> Wavelet Tree hot sheet + Persistent Data Structures hot sheet
- live xor-max queries over one multiset of integers -> Binary Trie hot sheet + Data structures cheatsheet
- online rank /
k-th in one dynamic ordered set -> Order Statistics Tree hot sheet + Data structures cheatsheet - meldable heaps over many singleton owners -> Pairing / Leftist Heap hot sheet + Data structures cheatsheet
- soft/random interval partitions with heavy range assign -> ODT / Chtholly hot sheet + Lazy Segment Tree hot sheet
- subset xor span / maximum subset xor -> XOR Basis hot sheet + Binary Trie hot sheet when xor semantics are ambiguous
- static RMQ on immutable data -> Sparse Table hot sheet + data-structures templates
- reorderable query batches -> Offline Tricks hot sheet + data-structures templates
- shortest paths -> Shortest Paths hot sheet + graph templates
- critical edges / cut vertices -> Low-Link hot sheet + Graph cheatsheet
- use-every-edge-once graph tasks -> Eulerian hot sheet + Graph cheatsheet
- binary clause feasibility -> Two-SAT hot sheet + Graph cheatsheet
- subtree-only tree aggregation -> Subtree Queries hot sheet + Graph cheatsheet
- subset-like exact search around
n ≈ 40-> Meet-In-The-Middle hot sheet + Complexity And Hardness - marked-subset tree compression -> Virtual Tree hot sheet + Graph cheatsheet
- tree path queries -> HLD hot sheet + Heavy-Light Decomposition
- balanced recursive tree splits -> Centroid hot sheet + Graph cheatsheet
- dynamic tree path queries -> Link-Cut Tree hot sheet + Link-Cut Tree
- if link-cut internals still feel black-box -> Splay Tree hot sheet + Splay Tree
- dynamic tree subtree-side queries -> Euler Tour Tree hot sheet + Treap / Implicit Treap hot sheet
- one undirected weighted graph with no designated
s-t, asking only for the cheapest disconnection cut -> Global Min-Cut hot sheet + Flow hot sheet - recover
xfroma^x ≡ b (mod m)-> Discrete Log hot sheet + Number Theory cheatsheet - recover one root from
x^2 ≡ a (mod p)-> Modular Square Root hot sheet + Number Theory cheatsheet - range-query structures -> Segment Tree hot sheet + Data structures cheatsheet
- true online range updates -> Lazy Segment Tree hot sheet + Segment Tree hot sheet
- harder clamp-style range updates -> Segment Tree Beats hot sheet + Lazy Segment Tree hot sheet
- flow or cuts -> Flow hot sheet + graph templates
- one undirected weighted graph with no designated
s-t, asking only for the cheapest disconnection cut -> Global Min-Cut hot sheet + Flow hot sheet - overlap-state window construction -> De Bruijn Sequence hot sheet + Eulerian hot sheet
- many undirected pairwise min-cuts -> Gomory-Hu hot sheet + Flow hot sheet
- mandatory lower / upper edge flow bounds -> Flow With Lower Bounds hot sheet + Flow hot sheet
- fixed-value costed transport -> Min-Cost Flow hot sheet + graph templates
- matching -> Matching hot sheet + Flow hot sheet when the reduction is ambiguous
- stable one-to-one pairing under strict preferences -> Stable Marriage hot sheet + Matching hot sheet
- dense weighted one-to-one assignment -> Hungarian hot sheet + Matching hot sheet
- rooted or center-rooted tree shape equality -> Tree Isomorphism hot sheet + Trees
- digit-counting over huge ranges -> Digit DP hot sheet + DP templates
- full mask-cube subset/superset aggregates -> SOS DP hot sheet + DP cheatsheet
- xor / subset-style boolean-cube transforms beyond plain zeta sweeps -> FWHT / XOR Convolution / Subset Convolution hot sheet + SOS DP hot sheet
- large boolean sum DP / component-size reachability -> Bit-Parallelism / Bitset Optimization hot sheet + Knapsack Family
- partition DP with monotone split points -> Divide and Conquer DP hot sheet + DP cheatsheet
- split-point interval DP with additive interval cost -> Knuth Optimization hot sheet + DP cheatsheet
- affine DP / online line minimum -> CHT / Li Chao hot sheet + DP templates
- exact-
Kchoices where one global penalty removes the count dimension -> Aliens Trick hot sheet + DP cheatsheet - convex piecewise-linear DP with hinge penalties or movement-style argmin widening -> Slope Trick hot sheet + DP cheatsheet
- future-hidden rent / buy / commit benchmark -> Online Algorithms hot sheet + Randomized Algorithms
- one linearly separable classifier with mistake-driven online updates -> Machine Learning hot sheet + Online Algorithms
- one smooth-loss breadth benchmark with deterministic full-batch updates -> Gradient Descent hot sheet + Machine Learning Algorithms
- one promise-problem quantum breadth benchmark around Hadamard layers and a phase oracle -> Quantum Algorithms hot sheet + FWHT / XOR Convolution / Subset Convolution
- one work/span breadth benchmark around a parallel scan tree -> Parallel Algorithms hot sheet + Prefix Sums
- one small continuous linear program in contest max form -> Simplex hot sheet + Optimization And Duality
- two matroid independence systems on one explicit ground set -> Matroid Intersection hot sheet + Optimization And Duality
- one linear system modulo one prime -> Gaussian Elimination hot sheet + Modular Arithmetic hot sheet
- congruence systems / composite-mod inverse -> Chinese Remainder hot sheet + Modular Arithmetic hot sheet
- huge binomial queries under one prime modulus -> Lucas Theorem hot sheet + Modular Arithmetic hot sheet
- gcd/divisor counting over all multiples -> Mobius hot sheet + Number theory cheatsheet
- summatory arithmetic functions that collapse into one divisor-side floor-sum -> Dirichlet prefix sums hot sheet + Number theory cheatsheet
- implicit prefix sums of
phi/muonQ_n-> Min_25 / Du Jiao hot sheet + Number theory cheatsheet - prime-mod root extraction -> Modular Square Root hot sheet + Modular Arithmetic hot sheet
- primitive-root finding under one prime modulus -> Primitive Root hot sheet + Number theory cheatsheet
- 64-bit factorization when
sqrt(n)trial division is dead -> Pollard-Rho hot sheet + Number theory cheatsheet - linear recurrence under one modulus -> Linear Recurrence hot sheet + Modular Arithmetic hot sheet
- higher-order recurrence jump or recurrence recovery from a prefix -> Berlekamp-Massey / Kitamasa hot sheet + Linear Recurrence hot sheet
- truncated FPS inverse / log / exp under one NTT-friendly prime -> Polynomial / FPS hot sheet + FFT / NTT
- impartial normal-play heaps/components -> Sprague-Grundy hot sheet + DP cheatsheet
- finite random process / exact event probability -> Probability hot sheet + DP cheatsheet
- small-width grid frontier occupancy -> Broken Profile hot sheet + DP cheatsheet
- modular arithmetic -> Modular Arithmetic hot sheet + math templates
- symmetry counting up to cyclic rotation -> Burnside / Pólya hot sheet + Modular Arithmetic hot sheet
- one static palindrome scan -> Palindromes hot sheet + string templates
- one append-only distinct-palindrome structure -> Eertree hot sheet + string templates
- substring fingerprints -> String Hashing hot sheet + string templates
- many exact patterns in one text -> Aho-Corasick hot sheet + string templates
- one small regex language matched as an epsilon-NFA -> Regex / Finite Automata hot sheet + String cheatsheet
- one optimal merge / prefix-code tree -> Huffman / Data Compression hot sheet + Greedy
- one static text as a compressed substring index -> Suffix Tree hot sheet + String cheatsheet
- exact static suffix structure -> Suffix Array / LCP hot sheet + string templates
- geometry predicates -> Geometry cheatsheet + geometry templates
- bounded half-plane feasibility / polygon kernel -> Half-Plane Intersection hot sheet + Geometry cheatsheet
- convex-region addition or scaled membership after polygon sums -> Minkowski Sum hot sheet + Geometry cheatsheet
- global nearest point-pair distance -> Nearest Pair hot sheet + Geometry cheatsheet
After This Page¶
- if trust in the snippet is still low, go back to
topics/ - if you now need the next problem, go to Problem Finder
- if you want a contest-format workflow, go to Contest Playbooks