| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1047 人关注过本帖
标题:一道题目,大家进来想想啊!
取消只看楼主 加入收藏
君子
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2005-11-23
收藏
 问题点数:0 回复次数:3 
一道题目,大家进来想想啊!
刚看的一道题:
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"
我想知道,那个人怎么推出来选的数的.
搜索更多相关主题的帖子: game face different following positive 
2005-11-27 11:44
君子
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2005-11-23
收藏
得分:0 
还是不懂...
如果另外那个人的数是11,他照样会说不知道啊
而且推理过程和 M:回答不知道的次数 没关系啊.

在计算机门外徘徊着.......
2005-11-27 22:22
君子
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2005-11-23
收藏
得分:0 
以下是引用tomic在2005-11-29 19:53:00的发言:
首先确定他们得到的数据是9和18,为什么要这样呢?

因为用的是逆推法.

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


在计算机门外徘徊着.......
2005-11-30 10:01
君子
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2005-11-23
收藏
得分:0 

那个...
ElfDN佩服得五体投地,可以加我吗?
我的QQ是305393812


在计算机门外徘徊着.......
2005-11-30 10:11
快速回复:一道题目,大家进来想想啊!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012622 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved