CHEFARK - Editorial

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…

https://www.codechef.com/viewsolution/10441994

Hi!! Can you please tell me the error in my code??

https://www.codechef.com/viewsolution/10467158

@lohit_97

I did this before but i was facing tle in one of the test case

link is:
https://www.codechef.com/viewsolution/10513481

@sammy00747 Instead of dividing,use modular-inverse of that number…
That will pass all the cases.

@sandeep9
I did this before but i was facing tle in one of the test case

link is: https://www.codechef.com/viewsolution/10513481

Can somebody point out the error in my solution. It only passed the first sub-task.

@anshika_1

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…

https://www.codechef.com/viewsolution/10441994

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…

https://www.codechef.com/viewsolution/10441994

please tell me what’s wrong in my code…https://www.codechef.com/viewsolution/10451475

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? :slight_smile: https://www.codechef.com/viewsolution/10410059
EDIT: I managed to get an AC with this approach. My inverse modulo was wrong.