zvrk
시간 제한: 2000ms메모리 제한: 128MB출처: CHC 2005 Croatian Olympiad in InformaticsBOJ 1407
문제
By removing all digits left of the rightmost digit one in the binary representation of some integer, we get what is called the "zvrk" of that number.
For example, the zvrk of 6 i.e. (110)2 is 2 i.e. (10)2, and the zvrk of 40 i.e. (101000)2 is 8 i.e. (1000)2.
Write a program that will calculate the sum of the zvrks of all numbers between two given numbers A and B (inclusive).
입력
First and only line of input contains two integers A and B, 1 ≤ A ≤ B ≤ 1015.
출력
First and only line of output should contain the sum from the problem statement.
Note: the result will fit into the 64-bit signed integer type (int64 in Pascal, long long in C/C++).
예제
예제 1
입력
176 177
출력
17
예제 2
입력
5 9
출력
13
예제 3
입력
25 28
출력
8
코드를 제출하려면 로그인하세요.