#P6218. Counting Circular Numbers
Counting Circular Numbers
Counting Circular Numbers
A positive integer is called a "circular number" if the number of \(0\)'s in its binary representation is not less than the number of \(1\)'s. For example, the binary representation of \(9\) is 1001
, which has 2 zeros and 2 ones, so \(9\) is a circular number.
Given two positive integers \(l\) and \(r\) representing an interval \([l, r]\), your task is to calculate how many circular numbers are within that interval.
inputFormat
The input consists of a single line containing two positive integers \(l\) and \(r\), separated by a space, representing the interval \([l, r]\).
outputFormat
Output a single integer which is the count of circular numbers in the interval \([l, r]\).
sample
1 10
6