You are viewing a single comment's thread. Return to all comments →
whats wrong in this code:
from itertools import combinations import math def nCr(n,r): f=math.factorial return f(n)//f(r)//f(n-r) N,K=map(int,input().split(" ")) A=list(map(int,input().split(" "))) B=list(combinations(A,K)) suma=[] for x in range(len(B)): s=1 for y in range(K): if(B[x][y]<4): c=1 else: c=nCr(B[x][y],4)+1 s=s*c suma.append(s) print(sum(suma)%(10**9 + 7))
shows memory error
Seems like cookies are disabled on this browser, please enable them to open this website
King and Four Sons
You are viewing a single comment's thread. Return to all comments →
whats wrong in this code:
shows memory error