Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/SuprDewd/CompetitiveProgramming
/ inv_sieve
Function
inv_sieve
code/mathematics/mod_inv_sieve.cpp:1–4 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
1
vi inv_sieve(int n, int p) {
2
vi inv(n,1);
3
rep(i,2,n) inv[i] = (p - (ll)(p/i) * inv[p%i] % p) % p;
4
return inv; }
5
// vim: cc=60 ts=2 sts=2 sw=2:
Callers
1
test
Function · 0.85
Calls
no outgoing calls
Tested by
1
test
Function · 0.68