Intelligent Dekisugi
CodeChefOpen on judge ↗
One day, after a difficult lecture a diligent student Dekisugi saw a graffitied desk in the classroom. He came closer and read: "Find such positive integer $n$, that among numbers n + 1, n + 2, ..., 2·n there are exactly $m$ numbers which binary representation contains exactly $k$ digits one". The boy got interested in the task and he asked you to help him solve it. Dekisugi knows that you are
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.
Sign in to chat with the tutor and save your progress.
Sign in to start