#P14074. [GESP202509 五级] 有趣的数字和
[GESP202509 五级] 有趣的数字和
Background
Corresponding multiple-choice and true/false questions: https://ti.luogu.com.cn/problemset/1193
To ensure that only algorithms with a reasonable time complexity can pass this problem, the time limit has been lowered.
Problem Description
If the binary representation of a positive integer contains an odd number of s, Little A considers this positive integer interesting.
For example, the binary representation of is , which contains ones, so is interesting. However, contains ones, so is not interesting.
Given positive integers , please count the sum of all interesting integers satisfying .
Input Format
One line with two positive integers , the given positive integers.
Output Format
One line with one positive integer, the sum of the interesting integers between and .
3 8
19
65 36248
328505490
Hint
Constraints
For of the test cases, .
For another of the test cases, and , where is a positive integer greater than .
For all test cases, .
Note
Because the constraints of this problem are large, use the long long integer type.
Translated by QwenWork