← All problemsSign in

Chef Restores a Matrix

CodeChefRating 1763Open on judge ↗

Chef defines a non-decreasing matrix as a matrix that satisfies the following rules: - For each row of the matrix, the elements of this row form a non-decreasing sequence. - For each column of the matrix, the elements of this column form a non-decreasing sequence. Chef has a matrix A with size N × M. Each element of this matrix is either unknown (denoted by -1) or a positive integer. Chef woul

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