Answer to Question #255530 in C for Jgg

Question #255530
Alice and Bob were playing a game with N piles of stones it is given thatthe number of stones choose in pile remove
1
Expert's answer
2021-10-23T08:05:35-0400

If and only if the number of piles is even, Alice wins.


There is just one way to lose immediately in any given condition, which is to remove a pile matching to the current XOR total. As a result, the only time a player is obliged to lose right away is when only one size of piles remains. The player would have won at the start of the turn if there were an even number of them, so it must be an odd number. The claim follows because one can only be compelled to lose when confronted with an odd number of piles, and it's always the same player that confronts an odd number of piles.


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS