← All problemsSign in

Repeat Binary

Given $x$ and $y$, find the number of integers between $x$ and $y$ (both inclusive) such that their binary representation is _repeating_. A _repeating_ string $s$ of size $n$ has the following property: - for all $1 \leq i \leq n - m, s_i = s_{i+m}$ for some $1 \leq m \lt n$ such that $m$ divides $n$. ### Input - A single line containing two space-separated integers $x

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start