×

Loading...

Here is my prove.

thinkinger (thinkinger)
本文发表在 rolia.net/zh 相约加拿大网上社区枫下论坛
Sorry, can't type Chinese.

Let's start from two couples: a-A, and b-B (a/b for wives, and A/B for husbands):
*Every wife holds a number 1, which is the number of total unfaithful husbands except their own, but they don't know whether the other wife is holding 1 or 0.
*On Day 1, they know if the other wife is holding 0, that wife will find out her husband is the only unfaithful husband. Therefore that wife will cook a good last meal for her husband, kisses him, asks passwords for bank accounts/Gmail/Facebook, and lastly but most importantly kills her husband by the end of Day 1. That wouldn't happen because no wife is holding 0.
*On Day 2, because no husband is killed, both of them find out the fact that every one is holding 1, which means their own husbands is unfaithful, they do what they suppose to do (kill..)

Let's move to three couples: a-A, b-B, and c-C:
*Every wife holds a number 2
*On Day 1, they are waiting for wives with number 0. It didn't happen.
*On Day 2, they are waiting for wives with number 1. It didn't happen.
*On Day 3, they realize the fact, and they all start on the same day (exact time may vary)

So on so on...

As a summary, 2 couples wait until Day 2, 3 couples wait until Day 3,...100 couples wait until Day 100.

That's it.
更多精彩文章及讨论,请光临枫下论坛. 网址: rolia.net/zh
(#10052000@0)
2016-4-15 -05:00
Reply
Page address has been copied.
To share, click to copy page address.
Share Online by QR Code

Back To Topic: 大学时看过的一道算法题,据说也是现在Google招程序员的面试题。

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习学科技术