• A funny question


    Q:Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and annoces that at least one husband has benn unfaithful. What happens?

    A:The queen said "at least one husband", so maybe more than one husband has been unfaithful.

    1. There is only one cheat husband. Assume the husband is A.

     First day, 99 wives except A's wife know A is unfaithful, but A know none of husbands is unfaithful. so A got the information from queen that her husband is cheeting. So she kill her husband, everything is over.

    2. There are two cheat husband. Assume they are A & B.

     First day, every wives know someone of husbands are unfaithful. So no man die. 

     Second day, because no one die in first day.Wives know there are more than one husband are cheeting, but A's wife and B's wife only know one, so they will kill their husbands.

    Same goes to 3,4,5...100 cheeting husbands.

    Conclusion:

     If there are N cheeting husband, in prime N-1 days, no husband have been killed, at the Nth day, N hasbands will be killed by their wives. 

  • 相关阅读:
    IP子网掩码格式转换
    错误: symbol lookup error: /usr/local/lib/libreadline.so.6: undefined symbol: PC
    postgresql删除属性
    postgresql 修改属性
    嵌套json的查询
    嵌套json
    关于array_agg 函数
    修改jsonb的属性
    Python中exec的使用
    RHSA-2017:2930-重要: 内核 安全和BUG修复更新(需要重启、存在EXP、本地提权、代码执行)
  • 原文地址:https://www.cnblogs.com/triStoneL/p/1905312.html
Copyright © 2020-2023  润新知