← All problemsSign in

Find XOR

CodeChefRating 1902Open on judge ↗

**This is an interactive problem.** There is a sequence of positive integers $A_1, A_2, \ldots, A_N$. You do not know this sequence, but your task is to find the value of $A_1 \oplus A_2 \oplus \ldots \oplus A_N$, where $\oplus$ denotes the bitwise XOR operation. You may ask up to $20$ questions. In each question, you should choose an integer $K$ ($1 \le K \le 2 \cdot 10^6$) and the interactor r

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