← All problemsSign in

Chef and Lost Story

CodeChefRating 2796Open on judge ↗

Once upon a time, in a land far, far away... nevermind, we don't recall the rest of the story. All we know is that Chef has a matrix of integers $M$ with $N$ rows and $N$ columns; he wants to take a single element from each row and a single element from each column ($N$ elements in total) and find their [bitwise XOR](https://en.wikipedia.org/wiki/Bitwise_operation#XOR). Find the set of all valu

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