← All problemsSign in

2DCompression

We have $HW$ cards arranged in a matrix with $H$ rows and $W$ columns. For each $i=1, \ldots, N$, the card at the $A_i$-th row from the top and $B_i$-th column from the left has a number $i$ written on it. The other $HW-N$ cards have nothing written on them. We will repeat the following two kinds of operations on these cards as long as we can. - If there is a row without a numbered card, remove al

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