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

Function gcd

test/unittest/internal_math_test.cpp:13–17  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using ull = unsigned long long;
12
13ll gcd(ll a, ll b) {
14 assert(0 <= a && 0 <= b);
15 if (b == 0) return a;
16 return gcd(b, a % b);
17}
18
19ll pow_mod_naive(ll x, ull n, uint mod) {
20 ull y = (x % mod + mod) % mod;

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected