Concepts52

Category

Level

Filtering by:
#competitive programming
MathAdvanced

Möbius Function and Inversion

The Möbius function μ(n) is 0 if n has a squared prime factor, otherwise it is (-1)^k where k is the number of distinct prime factors.

#mobius function#mobius inversion#dirichlet convolution+12
MathAdvanced

Divisor Function Sums

Summing the divisor function d(i) up to n equals counting lattice points under the hyperbola xy ≤ n, which can be done in O(√n) using floor-division blocks.

#divisor function#euler totient#mobius function+11
⚙️AlgorithmAdvanced

Sqrt Decomposition on Queries

Sqrt decomposition on queries (time blocking) processes Q operations in blocks of size about \(\sqrt{Q}\) to balance per-query overhead and rebuild cost.

#sqrt decomposition#time blocking#query blocking+12
⚙️AlgorithmAdvanced

Polynomial Operations

Fast polynomial operations treat coefficients like numbers but use FFT/NTT to multiply in O(n \log n) time instead of O(n^2).

#polynomial#ntt#fft+12
⚙️AlgorithmAdvanced

Convolution Applications

Convolution turns local pairwise combinations (like matching characters or adding two dice) into a single fast transform–multiply–inverse pipeline.

#convolution#fft#ntt+12
⚙️AlgorithmAdvanced

NTT (Number Theoretic Transform)

The Number Theoretic Transform (NTT) is an FFT-like algorithm that performs discrete convolutions exactly using modular arithmetic instead of floating-point numbers.

#ntt#number theoretic transform#polynomial multiplication+11
⚙️AlgorithmAdvanced

Mo's Algorithm - With Updates

Mo's algorithm with updates treats array modifications as a third dimension called time and answers range queries on the correct version of the array.

#mo's algorithm with updates#time dimension#offline range queries+11
⚙️AlgorithmAdvanced

DSU on Tree (Sack)

DSU on Tree (also called the Sack technique) answers many subtree queries in O(n \log n) by keeping data from the heavy child and temporarily re-adding light subtrees.

#dsu on tree#sack technique#subtree queries+12
⚙️AlgorithmAdvanced

Rectangle Union Area

The union area of many axis-aligned rectangles can be computed efficiently using a sweep line over x and a segment tree tracking covered y-length.

#rectangle union area#line sweep#segment tree+12
⚙️AlgorithmAdvanced

Suffix Array Construction

A suffix array stores the starting indices of all suffixes of a string in lexicographic order, enabling fast substring queries and many string operations.

#suffix array#lcp array#kasai+12
⚙️AlgorithmAdvanced

Slope Trick

Slope Trick is a technique to maintain a convex piecewise-linear function implicitly using two heaps and a running constant.

#slope trick#convex dp#piecewise linear+11
⚙️AlgorithmAdvanced

Subset Sum Convolution

Subset Sum Convolution (often called Subset Convolution) computes C[S] by summing A[T]×B[U] over all disjoint pairs T and U whose union is S.

#subset convolution#subset sum convolution#sos dp+11