Guess the number

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 160000/160000 K (Java/Others)
Total Submission(s): 163    Accepted Submission(s): 60

Problem Description
AOA just met a problem when he attended an interview, as shown below:
A and B two people play guessing games. A thinks of a number x between a and b randomly in his mind, and he lets B to guess this number. A will say too small if B’s guess is less than x and A will say yes if B’s guess is just x.Once B’sguess is bigger than x,A won't speak any more.After that,A just nods his head if B’s guess is just x,otherwise shakes his head.The problem is that how many kinds of best guess strategies to make the least number of guesses in the worst situation?
 
Input
Input contains multiple sets of test data and each of them occupies one line,including two integersa, b(1≤a≤b≤5 * 10^6),on behalf of range of the number.Input to the end of the file.
 
Output
For each set of input, output one line containing two integers. The first one represents the least number of times of guessing in the worst situation. The second one represents the number of best guess method modulo 100000073.
 
Sample Input
1 5
 
Sample Output
3 3

Hint

B can guess the number in A's mind up to 3 times in the worst case.
The first method,B can guess in the order of (2,4,5)
The second method,B can guess in the order of (3,4,5)
The third method,B can guess in the order of (3,5)
Each method is up to three times.

 
Source
 
Recommend
 
 
 

hdu 5981 Guess the number的更多相关文章

  1. HDU.1394 Minimum Inversion Number (线段树 单点更新 区间求和 逆序对)

    HDU.1394 Minimum Inversion Number (线段树 单点更新 区间求和 逆序对) 题意分析 给出n个数的序列,a1,a2,a3--an,ai∈[0,n-1],求环序列中逆序对 ...

  2. hdu 6216 A Cubic number and A Cubic Number【数学题】

    hdu 6216 A Cubic number and A Cubic Number[数学] 题意:判断一个素数是否是两个立方数之差,就是验差分.. 题解:只有相邻两立方数之差才可能,,因为x^3-y ...

  3. HDU 1394 Minimum Inversion Number(线段树求最小逆序数对)

    HDU 1394 Minimum Inversion Number(线段树求最小逆序数对) ACM 题目地址:HDU 1394 Minimum Inversion Number 题意:  给一个序列由 ...

  4. HDU 6093 - Rikka with Number | 2017 Multi-University Training Contest 5

    JAVA+大数搞了一遍- - 不是很麻烦- - /* HDU 6093 - Rikka with Number [ 进制转换,康托展开,大数 ] | 2017 Multi-University Tra ...

  5. ACM-ICPC 2016 大连赛区现场赛 K. Guess the number && HDU 5981(思维+DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5981 题意:A在[L, R]之间随机选取一个数X,之后B来猜这个数,如果猜的数比X小,那么A就告诉B猜 ...

  6. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  7. HDU 1394 Minimum Inversion Number ( 树状数组求逆序数 )

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1394 Minimum Inversion Number                         ...

  8. HDU 1394 Minimum Inversion Number(线段树/树状数组求逆序数)

    Minimum Inversion Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java ...

  9. 【HDU 3709】 Balanced Number (数位DP)

    Balanced Number Problem Description A balanced number is a non-negative integer that can be balanced ...

随机推荐

  1. tpot蜜罐平台搭建

    iso安装:https://github.com/dtag-dev-sec/tpotce autoinstaller安装:https://github.com/dtag-dev-sec/tpotce ...

  2. javascript自定义属性的应用

    你知道吗?JavaScript可以为任何HTML元素添加任意的自定义属性,而且你可能无意中已经使用过自定义属性了,那么自定义属性通常有哪些应用呢? 1.想用“匹配”.对应关系的时候就用索引值 2.同时 ...

  3. Css选择器定位详解

    1.使用 class 属性来定位元素,方法如下: driver.findElement(By.cssSelector("input.login")); 即可以先指定一个 HTML的 ...

  4. 浅谈REDIS数据库的键值设计(转)

    add by zhj: 关系数据库表的一条记录可以映射成Redis中的一个hash类型,其实数据库记录本来就是键值对.这样,要比本文中的键设计用更少的键,更节省内存,因为每个键除了它的键值占用内存外, ...

  5. MongoDB的Python客户端PyMongo(转)

    原文:https://serholiu.com/python-mongodb 这几天在学习Python Web开发,于是做准备做一个博客来练练手,当然,只是练手的,博客界有WordPress这样的好玩 ...

  6. django--博客系统--后台管理

    1.后台管理功能主要实现了,文章的添加与修改,以及富文本的使用 前端页面 母版 <!DOCTYPE html> <html lang="en"> <h ...

  7. python web框架 Django的APP以及目录介绍 django 1.11版本

    如果有很多业务请求函数 应该放在app目录 很多业务放在主站上 当用户一点跳到分站 例如 一个项目叫运维平台  他的业务 有资产管理 私有云 监控 不同业务线 chouti项目 - chouti - ...

  8. 006-shiro授权

    一.授权流程 二.三种授权方式 2.1.编程式:通过写if/else 授权代码块完成: Subject subject = SecurityUtils.getSubject(); if(subject ...

  9. matlab出错及改正

    1 使用小波分析时,出现下面错误: 错误使用 wavedec需要的 X 应为 矢量.出错 wavedec (line 34)validateattributes(x,{'numeric'},{'vec ...

  10. Config Static IP Address manually in Ubuntu

    The process of the configuration of static IP address in Ubuntu is as follows: ``` $ sudo vim /etc/n ...