Tags → #cp
-
Week 2 Day 5: Matrix Exponentiation - Breaking the Speed Limit
How to solve linear recurrences like Fibonacci in O(log n) time instead of O(n). A powerful technique for advanced DP problems.
-
Week 2 Day 4: Fermat & Euler - The Giants of Number Theory
Understanding Fermat’s Little Theorem and its big brother, Euler’s Totient Theorem. Key concepts for encryption.
-
Week 2 Day 3: The Modular Inverse - How to Divide
Division doesn’t exist in modular arithmetic. Instead, we multiply by the inverse. Learn Fermat’s Little Theorem and the Extended Euclidean Algorithm.
-
Week 2 Day 2: The Rules of Modular Arithmetic
Addition, Subtraction, Multiplication, and Division in the modular world. Why (a/b) % m is NOT (a%m / b%m).
-
Week 2 Day 1: Fast Modular Exponentiation - The Secret Weapon
How to calculate huge powers modulo m in logarithmic time. The backbone of modern cryptography.
-
Week 1 Day 5: Prime Factorization - The Atoms of Numbers
Every number is built from primes. Learn how to break them down efficiently using Trial Division and Sieve optimization.
-
Week 1 Day 4: Finding Primes Fast - The Sieve of Eratosthenes
Stop checking primality one by one. Learn the Sieve of Eratosthenes to generate millions of primes efficiently.
-
Week 1 Day 3: LCM in the Wild - Scheduling & Cycles
How to use Least Common Multiple to solve real-world scheduling problems, find cycles in data, and align periodic events.
-
Week 1 Day 2: The Euclidean Algorithm - Speeding up GCD
Deep dive into one of the oldest and most elegant algorithms in history. We explore why it works, its geometric intuition, and its time complexity.
-
Week 1 Day 1: The Magic of GCD & LCM
Starting our number theory journey with the absolute fundamentals: Greatest Common Divisor and Least Common Multiple. Learn why they matter in coding and how to implement them efficiently.