You are on page 1of 7

IMPORTANT

MATH TOPICS
FOR

COMPETITIVE
PROGRAMMING
1. MODULAR ARITHMETIC

Properties of the modulo


operator
Integer overflow
What does "modulo by
1e9+7" in a problem
indicate?
2. BITWISE OPERATORS

Properties of AND, OR,


XOR, NOT operators
Bitmasks and Bitsets
Common ways to use
bitwise operators to
optimize code
3. PRIMES, FACTORS, ETC

Factorization + Prime
Factorization
Number/Sum of Divisors
Primality testing
Sieve of Eratosthenes
Smallest Prime Factor
4. BINARY EXPONENTIATION

Calculates power of a
number
Modular exponentiation
Matrix exponentiation
(only basics)
5. EUCLIDEAN ALGORITHM

Calculates GCD of 2
numbers
Extended Euclidean
Algorithm
General Modular Inverse
Linear Diophantine
Equations
6. EULER'S TOTIENT FUNCTION

Count number of
coprime numbers to N
Euler's Theorem
Fermat's Theorem
Modular Inverse wrt a
Prime

You might also like