编程介的小学生 2019-09-01 21:54 采纳率: 20.5%
浏览 156

To go or not to go 怎么用C语言运算

Problem Description
LL is very lazy. Recently, he is assigned to a dormitory in the 5th floor and sometimes it's hard for him to decide whether to step out for some snack at night. So he choose two positive integers x, y and decide to go or not to go by the low bit of x (l is the length of x in binary representation). If it is "1", he choose to go and if it is "0", he stay in the dormitory.

Input
Each line contain two positive integers a and b (both not larger than 10^7 and a<=b). x is randomly chosen from [a,b]. No limit on y.

Output
For each case, output the probability (accurate to 6 fractional digits) of getting "1".

Sample Input
1 1
3 5

Sample Output
1.000000
0.666667

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 一道python难题
    • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 oracle集群安装出bug
    • ¥15 关于#python#的问题:自动化测试
    • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
    • ¥15 教务系统账号被盗号如何追溯设备
    • ¥20 delta降尺度方法,未来数据怎么降尺度