Concepts52

๐Ÿ—‚๏ธData StructureAdvanced

Sqrt Tree

A sqrt tree is a layered block-decomposition data structure that answers range queries in O(1) time after O(n \log \log n) preprocessing.

#sqrt tree#range query#associative operation+11
๐Ÿ—‚๏ธData StructureAdvanced

Segment Tree with Range Affine Transformation

A segment tree with lazy propagation can support range updates of the form x โ†’ aยทx + b (affine transformations) and range-sum queries in O(log n) per operation.

#segment tree#lazy propagation#affine update+12
โˆ‘MathAdvanced

Floor Sum Formula

The floor sum computes S(n,m,a,b) = sum_{i=0}^{n-1} floor((a i + b)/m) efficiently in O(log(min(a,m))) time.

#floor sum#atcoder library#euclidean algorithm+12
โš™๏ธAlgorithmAdvanced

DP on Broken Profile - Plug DP

Plug DP (DP on broken profile with plugs) sweeps a grid cell by cell while remembering how partial path segments cross the frontier as labeled โ€œplugs.โ€

#plug dp#broken profile#hamiltonian path+12
โš™๏ธAlgorithmAdvanced

Matrix Exponentiation - Advanced

Matrix exponentiation turns repeated linear transitions into fast O(n^{3} log k) computation using exponentiation by squaring.

#matrix exponentiation#adjacency matrix#walk counting+12
๐Ÿ—‚๏ธData StructureAdvanced

Top Tree

Top trees are dynamic tree data structures that represent a forest as a hierarchy of clusters, allowing O(log n) amortized time for link, cut, path queries/updates, and many subtree queries.

#top tree#dynamic tree#link cut+12
โˆ‘MathAdvanced

Partition Function

The partition function p(n) counts the number of ways to write n as a sum of positive integers where order does not matter.

#partition function#integer partitions#euler pentagonal theorem+11
โˆ‘MathAdvanced

Generating Functions - OGF

An ordinary generating function (OGF) encodes a sequence (a_n) as a formal power series A(x) = \sum_{n \ge 0} a_n x^n.

#ordinary generating function#ogf#coefficient extraction+12
โˆ‘MathAdvanced

Stirling Numbers of First Kind

Stirling numbers of the first kind count permutations by their number of cycles and connect power polynomials to rising/falling factorials.

#stirling numbers of the first kind#unsigned cycle numbers#signed stirling numbers+12
โˆ‘MathAdvanced

Discrete Logarithm

The discrete logarithm problem asks for x such that g^x โ‰ก h (mod p) in a multiplicative group modulo a prime p.

#discrete logarithm#baby-step giant-step#pollard rho dlp+12
โˆ‘MathAdvanced

Pollard's Rho Factorization

Pollard's Rho is a randomized algorithm that finds a non-trivial factor of a composite integer by walking a pseudorandom sequence modulo n and extracting a factor with a gcd.

#pollard's rho#integer factorization#cycle detection+10
โˆ‘MathAdvanced

Quadratic Residues

A quadratic residue modulo an odd prime p is any a for which x^2 โ‰ก a (mod p) has a solution; exactly half of the nonzero classes are residues.

#quadratic residues#legendre symbol#euler criterion+12