MCPcopy Create free account
hub / github.com/atcoder/ac-library / inv_mod

Function inv_mod

atcoder/math.hpp:26–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26long long inv_mod(long long x, long long m) {
27 assert(1 <= m);
28 auto z = internal::inv_gcd(x, m);
29 assert(z.first == 1);
30 return z.second;
31}
32
33// (rem, mod)
34std::pair<long long, long long> crt(const std::vector<long long>& r,

Callers 1

TESTFunction · 0.85

Calls 1

inv_gcdFunction · 0.85

Tested by 1

TESTFunction · 0.68