← All problemsSign in

Sussy Rooks

CodeChefRating 2996Open on judge ↗

You have an $N \times M$ grid. The grid can be filled with the values $0$ and $1$ only. Initially, **all** the cells of the grid are filled with value $0$. You start from the cell $(1,1)$. When you are at position $(i,j)$, you can do one of the following: - Change $A_{(i,j)}$ to $1$ and go to cell $(i+1,j+1)$. - Keep $A_{(i,j)}$ as $0$ and go to cell $(i+1,j)$ or $(i,j+1)$. If, at some point

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