module AtCoder::Math
Overview
Implements ACL's Math library
Defined in:
math.crClass Method Summary
-
.crt(remainders, modulos)
Implements atcoder::crt(remainders, modulos).
- .extended_gcd(a, b)
-
.floor_sum(n, m, a, b)
Implements atcoder::floor_sum(n, m, a, b).
- .get_primitive_root(p : Int)
-
.inv_mod(value, modulo)
Implements atcoder::inv_mod(value, modulo).
-
.mul_mod(a : Int64, b : Int64, mod : Int64)
Caluculates a * b % mod without overflow detection
- .mul_mod(a, b, mod)
-
.pow_mod(base, exponent, modulo)
Simplified AtCoder::Math.pow_mod with support of Int64
-
.product_greater_than(a : Int, b : Int, target : Int)
Returns
a * b > target
, without concern of overflows.
Class Method Detail
def self.mul_mod(a : Int64, b : Int64, mod : Int64)
#
Caluculates a * b % mod without overflow detection
Returns a * b > target
, without concern of overflows.