#P8764. [蓝桥杯 2021 国 BC] 二进制问题
[蓝桥杯 2021 国 BC] 二进制问题
Problem Description
Xiaolan has been learning binary recently. He wants to know how many numbers from to have exactly 1s in their binary representation. Can you help him?
Input Format
Input one line containing two integers and .
Output Format
Output one integer representing the answer.
7 2
3
Hint
For of the testdata, .
For of the testdata, .
For all testdata, .
Lanqiao Cup 2021 National Contest, Group B Problem H (Group C Problem J).
Translated by ChatGPT 5