Compute the Combination

Let P = C(N,0) - C(N,1) + C(N,2) - C(N,3) + … + C(N,N); where C(n,r) is “n choose r”. You are give…

Click here to read the complete problem statement.


If you need help solving this problem, mention your approach and ask specific questions. Please avoid sharing your code and asking the Community to figure out “what’s wrong”.

1 Like

test=int(input())
for i in range(test):
number=int(input())
print(0)
i have tried solving this problem using the above algorithm, which obviously yields the correct answer for test case 1, but it says 'CPU LIMIT EXCEEDED ’ for the second test case. How is it possible?

This problem’s judge-dataset is huge. So this problem can not be solved using Python, within the time limit. :cold_sweat:

Although your approach is incorrect.

I used a different algorithm before, but even that got the same response. Anyway Thanks bro