MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / exgcd

Method exgcd

Math/Reeds Sloane Algorithm.cpp:48–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 return A;
47 }
48 static void exgcd(ll a, ll b, ll &g, ll &x, ll &y) {
49 if (!b) x = 1, y = 0, g = a;
50 else {
51 exgcd(b, a % b, g, y, x);
52 y -= x * (a / b);
53 }
54 }
55 static ll crt(const vec &c, const vec &m) {
56 int n = c.size();
57 ll M = 1, ans = 0;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected