~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
Advanced & competitive
Number theory
Modular arithmetic, primes, matrix powers.
18 problems
Advanced & competitive
Number theory Modular arithmetic, primes, matrix powers.
Modular arithmetic
- Basics: dividing under a prime modulus basics easy
- Yeast growth over a range of hours py · c++ · java easy
- Pow(x, n) py · c++ · java easy
- Power with a huge digit-list exponent py · c++ · java medium
- Modular exponentiation py · c++ · java easy
- nCr mod p for many queries py · c++ · java medium
- Inverse modulo a prime py · c++ · java easy
Primes, divisors and GCD
- Basics: all divisors up to the square root basics py · c++ · java easy
- Festival lanterns blinking together py · c++ · java easy
- Count Primes py · c++ · java easy
- Split a deck into equal groups py · c++ · java easy
- Divisor counts for many numbers py · c++ · java medium
- Greatest common divisor (Euclid) py · c++ · java easy
- Prime factorization py · c++ · java easy
Matrix exponentiation
- Basics: matrix multiply and matrix power basics easy
- Seed library with donations py · c++ · java easy
- N-th Tribonacci Number easy
- Huge Fibonacci numbers mod p py · c++ · java easy