#P6218. [USACO06NOV] Round Numbers S
[USACO06NOV] Round Numbers S
Problem Description
If the binary representation of a positive integer contains at least as many 's as 's, then it is called a "round number".
For example, the binary representation of is , which has zeros and ones. Therefore, is a "round number".
Please calculate how many "round numbers" are in the interval .
Input Format
One line containing two integers .
Output Format
One line containing one integer, the number of "round numbers" in the interval .
2 12
6
Hint
Constraints
For of the testdata, .
Sample Explanation
There are "round numbers" in the interval : .
Translated by ChatGPT 5