↓ 1 callersFunctionCRTfinds x such that x % m1 = a1, x % m2 = a2. m1 and m2 may not be coprime here, x is unique modulo m = lcm(m1, m2). returns (x, m). on failure, m = -1.
Number Theory/Intersection of Arithmetic Progressions.cpp:21
↓ 1 callersFunctionCRTfind z such that z % x = a, z % y = b. here, z is unique modulo M = lcm(x,y). returns (z, M). on failure, M = -1.
Number Theory/Smallest Nonnegative Integer x s.t. l <= ax % p <= r.cpp:24
↓ 1 callersFunctionCRTfinds x such that x % m1 = a1, x % m2 = a2. m1 and m2 may not be coprime here, x is unique modulo m = lcm(m1, m2). returns (x, m). on failure, m = -1.
Number Theory/nCr Modulo Any Mod.cpp:75
↓ 1 callersFunctionSQRTfind sqrt(a) % p, i.e. find any x such that x^2 = a (mod p) if a solution exist, then if a == 0 or p == 2, there are 1 solution, otherwise, there are
Number Theory/Tonelli Shanks Algorithm.cpp:19