Fading Coder

One Final Commit for the Last Sprint

Solving Linear Congruence Equations with Extended Euclidean Algorithm

The Extended Euclidean Algorithm is a fundamental tool for solving linear Diophantine equations of the form ax + by = gcd(a, b). This technique is frequently required in competitive programming to solve problems involving modular arithmetic and periodic patterns, such as the classic "Frog's Mee...

Core Number Theory Algorithms: Primes, Divisors, and Euler's Totient

1. Greatest Common Divisor via Euclidean Method The Euclidean algorithm efficiently determines the largest shared divisor between two integers by repeatedly applying the modulo operation. // Time Complexity: O(log(min(a, b))) int compute_gcd(int first, int second) { while (second != 0) { int remaind...