Xor Again
Chef recently discovered a function $XOR()$, which computes the XOR of all elements of a sequence: $$XOR(a_{1..n}) = a_1 \oplus a_2 \oplus \dots \oplus a_n\,.$$ Chef has a sequence $A$ with size $N$. He generated a new sequence $B$ with size $N^2$ using the following formula: $$B_{iN+j+1} = (A_{i+1} + A_{j+1}) \quad \forall\; 0 \le i, j \lt N\,.$$ Compute the value of $XOR(B)$. ### Input - The
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