[Help] Problem 1695B "circle game" logic when n is odd

Revision en1, by vivek., 2022-07-14 21:46:56

Hello, In the Problem 1695B ( https://codeforces.com/contest/1695/problem/B ), when no. of piles is odd i.e. n is odd, the solution (tutorial) states the following statement: "If n is odd, Mike can remove all of the stones from the first pile. Then, on the n+1th turn (the first turn where the game can end), Joe will be forced to remove from the first pile, which is empty. So Mike can always win if n is odd."

But when observed for below example , n=5 entries=9 1 8 10 11 after first iteration the entries will be: 8 0 7 9 10 , and the turn will be of Mike at zero and thus Joe will win. This contradicts the tutorial solution.

If the tutorial solution is correct, please explain the logic for the same.

Thank you

Tags 1695b, logic

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English vivek. 2022-07-14 21:46:56 783 Initial revision (published)