CF611B.New Year and Old Property

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The year 2015 is almost over.

Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary system — 201510=1111101111122015_{10}=11111011111_{2} . Note that he doesn't care about the number of zeros in the decimal representation.

Limak chose some interval of years. He is going to count all years from this interval that have exactly one zero in the binary representation. Can you do it faster?

Assume that all positive integers are always written without leading zeros.

输入格式

The only line of the input contains two integers aa and bb ( 1<=a<=b<=10181<=a<=b<=10^{18} ) — the first year and the last year in Limak's interval respectively.

输出格式

Print one integer – the number of years Limak will count in his chosen interval.

输入输出样例

  • 输入#1

    5 10
    

    输出#1

    2
    
  • 输入#2

    2015 2015
    

    输出#2

    1
    
  • 输入#3

    100 105
    

    输出#3

    0
    
  • 输入#4

    72057594000000000 72057595000000000
    

    输出#4

    26
    

说明/提示

In the first sample Limak's interval contains numbers 510=10125_{10}=101_{2} , 610=11026_{10}=110_{2} , 710=11127_{10}=111_{2} , 810=100028_{10}=1000_{2} , 910=100129_{10}=1001_{2} and 1010=1010210_{10}=1010_{2} . Two of them ( 1012101_{2} and 1102110_{2} ) have the described property.

首页