module

AtCoder::Math

Implements ACL's Math library

Class methods

crt(remainders, modulos)

Implements atcoder::crt(remainders, modulos).

Source
extended_gcd(a, b)
Source
floor_sum(n, m, a, b)

Implements atcoder::floor_sum(n, m, a, b).

Source
get_primitive_root(p : Int)
Source
inv_mod(value, modulo)

Implements atcoder::inv_mod(value, modulo).

Source
mul_mod(a : Int64, b : Int64, mod : Int64)

Caluculates a * b % mod without overflow detection

Source
mul_mod(a, b, mod)
Source
pow_mod(base, exponent, modulo)

Simplified AtCoder::Math.pow_mod with support of Int64

Source
product_greater_than(a : Int, b : Int, target : Int)

Returns a * b > target, without concern of overflows.

Source