← All problemsSign in

Chef and Pair Flips

CodeChefRating 3099Open on judge ↗

Chef has two matrices $A$ and $B$, each with size $N \times M$. Each cell of the matrix $A$ contains a character '0' or '1', while each cell of the matrix $B$ contains '?', '0' or '1'. The matrix $A$ can be modified using zero or more operations. In one operation, Chef can choose two cells in the matrix $A$ which lie either in the same row or in the same column and flip the characters in each o

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