当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3750:Guess Game

题目描述
Bob plays the "guess the number right" with Alice recently,the game's rule is that Alice give Bob a upper limit number N ,then he write any of a number on paper which Bob can't know what it is and the number must be between 1 and N.Bob has many chances to guess the number and every time when Bob guesses Alice will tell him if his is bigger than the correct number or small than the correct number until he is right.
Now the Bob wanted to use binary search method to guess the right number, because he knows this method is quite fast to find the right number.
输入解释
We test the problem in many cases.Each case begin with one integers N( 1<= N <= 100000 ).
输出解释
Output the expected number of chances required to guess the number right, which accurate to 2 fractional digits.
输入样例
2
3
输出样例
1.50
1.67
来自杭电HDUOJ的附加信息
Author erriyue
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3750

最后修改于 2020-10-25T23:06:39+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)