If $J(n) = \displaystyle{\frac{n}{2}}$ , binary representation of $n$ will be $101010....$ . We can prove that by easy induction or basic algebra. Rest of the process is easy. Find all the numbers which satisfy this. then for Every query, loop over the numbers and count them.

Statistics

83% Solution Ratio
EgorKulikovEarliest, Apr '20
nusuBotFastest, 0.0s
vipghn2003Lightest, 2.2 MB
Dipto_DebdipShortest, 237B
Toph uses cookies. By continuing you agree to our Cookie Policy.