Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
1
ll 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_congruence
Function · 0.85
test
Function · 0.85
mod_inv
Function · 0.85
crt
Function · 0.85
Calls
no outgoing calls
Tested by
1
test
Function · 0.68