WA in PSHOT

Problem link : https://www.codechef.com/problems/PSHOT
My solution : https://www.codechef.com/viewsolution/29777332
I have tried many test cases and it always matched with the output but I am still getting WA .
Can somebody tell me why this is not working ??

My code is same as yours even i got wrong answer.

If we are in position i , there are two cases : if 2n-i is even , each player has equal number of chances , but in case where 2n-i is odd , we have to check whether the current i is odd or even since one player plays (2n-1)/2 games and other one plays 2n-((2*n-1)/2 )

1 Like