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. docker,构建nginx反向代理tomcat

    Nginx实现负载均衡是通过配置nginx.conf来实现的,nginx.conf的全部内容如下: user nginx; worker_processes 1; error_log /var/log ...

  2. javaweb项目中嵌入webservice--axis2

    由于最近项目中需要搭建webservice服务端,由于原项目是javaweb项目,所以需要整合.之前用cxf试了,启动老是报错,maven依赖冲突.后来索性换成axis2 百度了一圈,下面这个博客 h ...

  3. rest_framake之视图

    开始,先放大招 一  最原始的写法 前戏之序列化 class AuthorSerializer(serializers.ModelSerializer): class Meta: model = mo ...

  4. TI C66x DSP 系统events及其应用 - 5.7(IST)

    当CPU開始处理一个中断(INT4~15)时,它将引用中断服务表(IST).IST是一个获取包括中断服务代码的包的表. IST包括16个连续的获取包.每个中断服务获取包(ISFP)包括最多14条指令( ...

  5. spring整合问题分析之-Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.

    1.异常分析 Write operations are not allowed in read-only mode (FlushMode.MANUAL): Turn your Session into ...

  6. Windows 7 下 Node.js 连接 Oracle

    原创作者: sailtseng 1. 安装 Oracle 11g express  详见: <Windows 7 x64 安装 Oracle 11g Express> 2. 安装 Micr ...

  7. Python之字符编码(Day10)

    1. python解释器执行py文件的原理 ,例如python test.py    第一阶段:python解释器启动,此时就相当于启动了一个文本编辑器 第二阶段:python解释器相当于文本编辑器, ...

  8. 第七课 GDB调试 (下)

    1序言: 通过前面一节第六课 GDB调试 (下)文章,可以掌握理解了gdb调试:怎么启动.运行,打断点.查看变量.甚至改变变量等的知识,今天来大概讲解下调试bug的类型. 2知识点: 2.1 就像之前 ...

  9. 参考MongoRepository,为接口生成bean实现注入

    首先弄个注解,给代码个入口,这个就是mongo的@EnableMongoRepositories了. @Target(ElementType.TYPE) @Retention(RetentionPol ...

  10. Python3.x:定时自动发送邮件

    定时自动发送邮件 一.简述 python发邮件需要掌握两个模块的用法,smtplib和email,这俩模块是python自带的,只需import即可使用.smtplib模块主要负责发送邮件,email ...