Advertisement
fooker

Erdos261

Mar 18th, 2023
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import math
  2. # f(n)=binom(binpow(2,n,m)-2,binpow(2,n-1,m)-1,m)*f(n-1)^2
  3. m = int(1e9+7)
  4. def binpow(x,y,z):
  5.     if (y==0):
  6.         return 1%z
  7.     res = binpow(x,y//2,z)
  8.     res = ((res%z)*(res%z))%z
  9.     if (y%2):
  10.         res = (res*x)%z
  11.     return res
  12. def binom(x,y,z):
  13.     ans = math.factorial(x)//(math.factorial(y)*math.factorial(x-y))
  14.     return ans%z
  15. ans = 1
  16. ans = (ans*binpow(80,8,m))%m
  17. print(ans)
  18. ans = (ans*binpow(binom(14,7,m),4,m))%m
  19. print(ans)
  20. ans = (ans*binpow(binom(30,15,m),2,m))%m
  21. print(ans)
  22. ans = (ans*binom(62,31,m))%m
  23. print(ans)
  24. # print(binom(4,2,m))
  25. # print(binom(8,2,m))
  26. # print(binom(6,3,m))
  27. # print(binom(5,2,m))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement