Page 1 of 1
10165 - Stone Game
Posted: Mon May 13, 2002 8:54 pm
by 10153EN
Dear all,
I still have no idea on how to solve this problem after thinking over it for some time. Could anyone give me some hint on it?
Thx.
Posted: Mon May 13, 2002 10:39 pm
by Stefan Pochmann
It's the "Nim" game and you should easily find information in google when you search for "nim" and "xor", for example here:
http://web.usna.navy.mil/~wdj/nim.htm
10165 - Stone Game
Posted: Fri Aug 02, 2002 1:09 am
by konsept
Hi,
Can someone explain the solution to this problem ?
it looks similar to the NIM-game.
Thank you.
Re: 10165 - Stone Game
Posted: Thu Aug 08, 2002 4:14 pm
by Shih-Chia Cheng
konsept wrote:Hi,
Can someone explain the solution to this problem ?
it looks similar to the NIM-game.
Thank you.
Convert all numbers into binary sequences and list them all one in a row.
Then you may think what the best strategy is for playing the game.
If this is still obscure, consider the special case when there are only two
piles of stones. Try to generalize your solution for this special case.
Good luck~

10165
Posted: Thu Jun 16, 2005 7:05 am
by Yu Fan
I've viewed some topics says that it could be solved with binary sequence... but i can't imagine it.
someone helps me?

Posted: Sat Jul 09, 2005 1:09 am
by vedex
I am not going to prove you why my solution is right. This is a very popular game called Nim. Lets say we have n stones a1, a2, ... , an
If, and only if, a1 xor a2 xor ... xor an = 0 =) 'NO'
a1 xor a2 xor ... xor an <> 0 =) 'YES'
Hay
Posted: Sun Apr 08, 2007 8:09 am
by Tanu
Yah thats true i got accepted by this way
but can anyone let me know how it works.
Thanks in advance...
- Tanu
