1. 16个人每人事先分别分配一个1-16间的不同数字
2. 每个人将其它15个人帽子上的数字之和对16取模,然后用事先分配的数字减去前面的结果
3. 上面的结果对16取模(1->1, -1->16-1=15),最后得到0-15间的一个数字。如果是0,则定为16。此即最后每人应猜的数字
回复:猜自己的帽子数字
所有跟帖:
•
赞!
-guest007-
♀
(28 bytes)
()
06/07/2010 postreply
10:02:44
•
Do not think it is going to work...
-innercool-
♂
(259 bytes)
()
06/07/2010 postreply
16:09:12
•
Your output is wrong
-twfx-
♂
(129 bytes)
()
06/07/2010 postreply
18:52:34
•
Sorry, you are right. And here is the proof of the correctness.
-innercool-
♂
(463 bytes)
()
06/07/2010 postreply
19:26:05