We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
# Enter your code here. Read input from STDIN. Print output to STDOUTimportmathn,k=map(int,input().split())defcombi(n,r):ifr==0orr==n:return(1)s,r=1,(n-rifn-r<relser)foriinrange(r):s*=((n-i)/(i+1))return(math.ceil(s))c=0foriinrange(1,n+1):forjinrange(i+1):ifcombi(i,j)>k:c+=1print(c)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #53: Combinatoric selections
You are viewing a single comment's thread. Return to all comments →