What is wrong with my code if only subtask one is considered?? the third task in subtask 1 showed wrong answer??
rest other were correct…
I did this before but i was facing tle in one of the test case
There exist overflow problem for higher values.Change your data type.Use the concept of mod 10^7 for computing higher values.
@prak_blah Yes. This is the case when there is no zero in the array. If there are say p zeroes then make n -= p
and add up nC0, nC1, nC2, …nCk.(if(k > n) make k = n).
And do anyone know how to comment on answer instead of writing another one?
https://www.codechef.com/viewsolution/10412867
why did this solution get tle in the final subtask?
I was calculating the sum of alternating binomial coefficients and this ncr function seems to be good.
plz help
https://www.codechef.com/viewsolution/10516305 I am unable to find the mistake in my solution. I hope I have made a subtle one. Any help is appreciated.
hat is wrong with my code if only subtask one is considered?? the third task in subtask 1 showed wrong answer?? rest other were correct…
hat is wrong with my code if only subtask one is considered?? the third task in subtask 1 showed wrong answer?? rest other were correct…
you should precompute all factorials upto 100000 before hand so that u dont have recompute them again and again
Hi! I tried a different approach , I followed this stack overflow answer and implemented it. However its failing on just 3 subtasks. I have been trying to find out why for the past few days. Can anyone help me debug? https://www.codechef.com/viewsolution/10410059
EDIT: I managed to get an AC with this approach. My inverse modulo was wrong.