Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sys import *
- setrecursionlimit(100000000)
- f = {0: 1}
- def fact(n):
- global f
- if not n in f:
- f[n] = n * fact(n - 1)
- return f[n]
- def c(m, n):
- return fact(n) // (fact(n - m)*fact(m))
- def light(n):
- ans = 1
- for i in range(1, n):
- ans += c(i, n)
- return ans
- for _ in range(int(input())):
- print(light(int(input())))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement