找回密码
 立即注册
搜索
总共850条微博

动态微博

查看: 2754|回复: 5
打印 上一主题 下一主题
收起左侧

囚 犯 问 题 新 版 (自 编 )[:D)]

[复制链接]

53

主题

363

帖子

4139

积分

楼主
发表于 2005-4-22 23:38:41 | 显示全部楼层

回复:囚 犯 问 题 新 版 (自 编 )[:D)]


Let n = number of current on switches, and a = n mod 15.If a is odd,turn on (15-a)/2 switches and turn off (15+a)/2 switches. If a = 0, turn off 15 switches. If a is even and > 0, turn on 7 and turn off 8 so it becomes odd.

Are there really bad prisoners that should not be released? If so, we change the rule to 14 switches every prizoner, but turn on an odd number of lights at the beginning. :)www.ddhw.com

 
回复 支持 反对

使用道具 举报

24小时热帖
    一周热门
      原创摄影
        美食美文
          您需要登录后才可以回帖 登录 | 立即注册

          本版积分规则

          Archiver|手机版|珍珠湾ART

          Powered by Discuz! X3 © 2001-2013 All Rights Reserved