diff options
-rw-r--r-- | Math/numtheory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Math/numtheory.cpp b/Math/numtheory.cpp index 8801426..02228e2 100644 --- a/Math/numtheory.cpp +++ b/Math/numtheory.cpp @@ -1,7 +1,5 @@ constexpr ll MOD = 1e9+7; -ll fact[MN] = { 1 }, ifact[MN] = { 1 }; - inline ll pw(ll base, ll exp) { ll res = 1; while (exp) { @@ -13,6 +11,8 @@ inline ll pw(ll base, ll exp) { inline ll inv(ll x) { return pw(x, MOD-2); } +ll fact[MN] = { 1 }, ifact[MN] = { 1 }; + inline ll nCr(int n, int k) { return fact[n]*ifact[k]%MOD*ifact[n-k]%MOD; } for (int i = 0; i < N; ++i) fact[i+1] = (i+1ll)*fact[i]%MOD, ifact[i+1] = inv(fact[i+1]); |