← All problemsSign in

Some More Homework

The following problem appeared in the CodeChef March '09 Challenge. In the computer science class at the school in Byteland, the teacher handed out the following assignment as homework: "For an integer n, let bn denote the bit parity of the binary representation of n, i.e. bn=0 if n has an even number of ones when written down in the binary system, and bn=1 otherwise. The numbers bn, for n >=0

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