Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SuprDewd/CompetitiveProgramming
/ mod_inv
Function
mod_inv
code/mathematics/mod_inv.cpp:2–4 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
#include
"egcd.cpp"
2
ll mod_inv(ll a, ll m) {
3
ll x, y, d = egcd(a, m, x, y);
4
return d == 1 ? smod(x,m) : -1; }
5
// vim: cc=60 ts=2 sts=2 sw=2:
Callers
2
operator /
Method · 0.85
test
Function · 0.85
Calls
2
egcd
Function · 0.85
smod
Function · 0.85
Tested by
2
operator /
Method · 0.68
test
Function · 0.68