回复:猜自己的帽子数字

1. 16个人每人事先分别分配一个1-16间的不同数字
2. 每个人将其它15个人帽子上的数字之和对16取模,然后用事先分配的数字减去前面的结果
3. 上面的结果对16取模(1->1, -1->16-1=15),最后得到0-15间的一个数字。如果是0,则定为16。此即最后每人应猜的数字

所有跟帖: 

赞! -guest007- 给 guest007 发送悄悄话 (28 bytes) () 06/07/2010 postreply 10:02:44

Do not think it is going to work... -innercool- 给 innercool 发送悄悄话 innercool 的博客首页 (259 bytes) () 06/07/2010 postreply 16:09:12

Your output is wrong -twfx- 给 twfx 发送悄悄话 (129 bytes) () 06/07/2010 postreply 18:52:34

Sorry, you are right. And here is the proof of the correctness. -innercool- 给 innercool 发送悄悄话 innercool 的博客首页 (463 bytes) () 06/07/2010 postreply 19:26:05

请您先登陆,再发跟帖!