From 1b48ab9c82babd7208ad31142214a36dd05caca7 Mon Sep 17 00:00:00 2001 From: Mizar Date: Sat, 21 Jan 2023 17:34:00 +0900 Subject: [PATCH] Fix comment in math https://github.com/atcoder/ac-library/pull/97 --- src/math.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math.rs b/src/math.rs index 25c3e60..d390501 100644 --- a/src/math.rs +++ b/src/math.rs @@ -135,7 +135,7 @@ pub fn crt(r: &[i64], m: &[i64]) -> (i64, i64) { // r2 % m0 = r0 // r2 % mi = ri // -> (r0 + x*m0) % mi = ri - // -> x*u0*g % (u1*g) = (ri - r0) (u0*g = m0, u1*g = mi) + // -> x*u0*g = ri-r0 (mod u1*g) (u0*g = m0, u1*g = mi) // -> x = (ri - r0) / g * inv(u0) (mod u1) // im = inv(u0) (mod u1) (0 <= im < u1)