Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def comb(n, r):
- return factorial(n) / (factorial(r) * factorial(n - r))
- def main():
- count = 0
- for n in range(1, 101):
- for r in range(n):
- if comb(n, r) > 1000000:
- count += 1
- return count
- CPU times: user 16 ms, sys: 0 ns, total: 16 ms
- Wall time: 17.8 ms
- Out: 4075
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement