MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / egcd

Function egcd

code/mathematics/egcd.cpp:1–4  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1ll egcd(ll a, ll b, ll& x, ll& y) {
2 if (b == 0) { x = 1; y = 0; return a; }
3 ll d = egcd(b, a % b, x, y);
4 x -= a / b * y; swap(x, y); return d; }
5// vim: cc=60 ts=2 sts=2 sw=2:

Callers 4

linear_congruenceFunction · 0.85
testFunction · 0.85
mod_invFunction · 0.85
crtFunction · 0.85

Calls

no outgoing calls

Tested by 1

testFunction · 0.68