Dull Operation
*Be afraid, be very afraid.* On Halloween, Chef is in a somber mood. Chef has an **odd** integer $N$ that he has to decode. To do so, Chef would like to find a pair of integers $x$ and $y$ ($0 \leq x, y \lt 2^{30}$) such that: $$ (x\mid y) \cdot (x\oplus y) = N $$ Help Chef find **any** such pair! It can be proved that a valid pair always exists. Here, $\mid$ represents the [bitwise OR]
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