找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 1568|回复: 8

一道题目,大家进来想想啊!

[复制链接]
发表于 2009-11-1 00:19:15 | 显示全部楼层 |阅读模式 IP:江苏扬州
刚看的一道题:
There is a legend that mathematicians in the XVIII century enjoyed playing the following game.

The game was played by three mathematicians. One of them was the game master. First of all, the game master declared some positive integer number N . After that he chose two different integer numbers X and Y ranging from 1 to N and told their sum to one player and their product to the other player. Each player knew whether he was told the sum or the product of the chosen numbers.

After that the players in turn informed the game master whether they knew the numbers he had chosen. First the player who was told the sum said whether he knew the numbers, after that the player who was told the product did, and so on.

For example the dialog could look like this:

Game master: "Let N be 10".

After that he chooses two numbers ranging from 1 to 10 and tells their sum to player S and their product to player P.

Player S: "I don't know these numbers."

Player P: "I don't know these numbers."

Player S: "I don't know these numbers."

Player P: "I don't know these numbers."

Player S: "Oh, now I know these numbers. You have chosen 3 and 6."

Given N and M -- the number of times the players have said "I don't know these numbers", you have to find all possible pairs of numbers that could have been chosen by the game master.
大致意思是有三个人,一个人声明一个正整数N,然后在1到N间随意取两个数,把和告诉一个人,把积告诉另外一个人(这两个人都知道知道的数是和或积).之后轮流问这两个人是否猜出他选的数.
比如: 这个人:"N是10"
第一个人:"我不知道"
第2人:"我不知道"
第一个人:"我不知道"
第2人:"我不知道"
第一个人:"我知道了,你选的是3和6"
发表于 2009-11-1 00:19:17 | 显示全部楼层 IP:江苏扬州
这个是IBM的测试题。。。。。
用逆推,首先确定他们得到的数据是9和18。18只有两个分法可以分成2和9,3和6。9的分法是3和3。但是已经说明是取两个数,9是乘积的可能被排除,能说明只有18是乘积,那么拿到9的人无论怎么都不敢说知道了,所以第二个人一定是拿到9的。而拿到18的人也是同样的道理,想要加出18必须是9和9也就是说一开始他就知道18是乘积了。最后可以得到结果,对方拿的是9,所以一直说不知道。
回复

使用道具 举报

发表于 2009-11-1 00:19:18 | 显示全部楼层 IP:江苏扬州
还是不懂...
如果另外那个人的数是11,他照样会说不知道啊
而且推理过程和 M:回答不知道的次数 没关系啊.
回复

使用道具 举报

发表于 2009-11-1 00:19:19 | 显示全部楼层 IP:江苏扬州
首先确定他们得到的数据是9和18,为什么要这样呢?
回复

使用道具 举报

发表于 2009-11-1 00:19:20 | 显示全部楼层 IP:江苏扬州
不过感觉挺有意思的
回复

使用道具 举报

发表于 2009-11-1 00:19:21 | 显示全部楼层 IP:江苏扬州
11需要解释么?
直接一看就知道是加出来的,然后你把11的和分解了看看,如果对方拿到那些数据,不直接把答案报出来只有18和24,其他的明显了!
回复

使用道具 举报

发表于 2009-11-1 00:19:23 | 显示全部楼层 IP:江苏扬州
以下是引用tomic在2005-11-29 19:53:00的发言:
首先确定他们得到的数据是9和18,为什么要这样呢?
因为用的是逆推法.

谢谢楼上的,我有点明白了..
回复

使用道具 举报

发表于 2009-11-1 00:19:24 | 显示全部楼层 IP:江苏扬州
那个...
对ElfDN佩服得五体投地,可以加我吗?
我的QQ是305393812
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-29 13:33 , Processed in 0.153064 second(s), 13 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表