← All problemsSign in

Guess the row

CodeChefRating 3031Open on judge ↗

You and Paolo are playing a game. Paolo, without letting you peek, writes down on a sheet of paper an $N\times N$ matrix of $0$s and $1$s (all the $N^2$ entries are either $0$ or $1$) such that, for each $1 \le k \le N$, there is a row with exactly $k$ ones. In all tests, $N = 50$. Your goal is to find the row with exactly $\lfloor\frac{N}{2} \rfloor$ ones. In order to do it, you may ask the fol

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