Sherlock and Matrix
CodeChefOpen on judge ↗
Sherlock has made a $N\times N$ (Numbered $1$ through $N$) square matrix on the floor with a colored pencil. Cell$(i,j)$ denotes the Cell at row $i$ and column $j$. And he has exactly $N^2$ toffees having price $P$ on it. He keeps all the toffees randomly on each cell. You can start from any Cell$(i,j)$ and can only move to the Cell$(i+1,j+1)$ or Cell$(i-1,j-1)$ and you can visit the Cells as long
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.
Sign in to chat with the tutor and save your progress.
Sign in to start