Skip to content

Math

Core Deep

Math gives you the compact facts and transforms that keep many contest solutions short, fast, and correct.

The Dependency Chain That Matters Most

Math is the easiest area to overlearn in the wrong order. In this repo, the most important dependency chain is:

Number Theory Basics -> GCD / LCM -> Modular Arithmetic -> CRT / Lucas -> deeper number-theory lanes

If that chain is not stable yet, do not jump early into discrete logs, Min_25, or polynomial / FPS work.

Use This Area When

  • the real blocker is divisibility, modular arithmetic, counting, or transforms
  • brute force is fine in shape but too expensive without number-theory compression
  • the clean solution needs one algebraic identity or arithmetic preprocessing trick

Start With One Route

If your bottleneck is... Open first Then
divisibility and primes Number Theory Basics GCD / LCM, then Modular Arithmetic
congruences and modular calculations Modular Arithmetic Chinese Remainder, Lucas Theorem
recurrence and algebra tools Linear Recurrence / Matrix Exponentiation Gaussian Elimination, Berlekamp-Massey / Kitamasa
transforms and polynomial work FFT / NTT Polynomial / Formal Power Series

Core Progression

  1. Core first
  2. Number Theory Basics
  3. GCD / LCM
  4. Modular Arithmetic

  5. Then add

  6. Chinese Remainder / Lucas Theorem
  7. Linear Recurrence / Matrix Exponentiation
  8. Gaussian Elimination
  9. Probability / Game Theory / XOR Basis

  10. Deep later

  11. BSGS / Discrete Log
  12. Modular Square Root / Discrete Root
  13. Primitive Root / Pollard-Rho
  14. Mobius / Dirichlet Prefix Sums / Min_25
  15. Berlekamp-Massey / Kitamasa
  16. FFT / NTT / Polynomial / FPS

Good First Repo Anchors

Browse All Subtopics

Go Deeper