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

Function gcd

test/unittest/math_test.cpp:12–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

TESTFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected