MCPcopy Create free account
hub / github.com/E869120/math-algorithm-book / ncr

Function ncr

codes/python/Code_5_07_2.py:16–18  ·  view source on GitHub ↗
(n, r)

Source from the content-addressed store, hash-verified

14
15# ncr は n! を r! × (n-r)! で割った値
16def ncr(n, r):
17 global fact, MOD
18 return division(fact[n], fact[r] * fact[n - r] % MOD, MOD)
19
20MOD = 1000000007
21LIMIT = 200000

Callers 1

Code_5_07_2.pyFile · 0.70

Calls 1

divisionFunction · 0.70

Tested by

no test coverage detected