Chef and Jail
CodeChefOpen on judge ↗
King of Chefland is very crurcial and coward. Chef is one of the soldiers of the king. Chef is brave and very powerful soldier. This is the reason that king is affraid of Chef. So, he trapped Chef in prison. Chef is kept in a special jail with tight security. There are $M x N$($M$ rows and $N$ columns) rooms in the jail and walls the room are made of stone. It is not possible to break the walls.
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