Ashish and Holidays
CodeChefOpen on judge ↗
Berland is a country which can be represented as a matrix of $M X N$ and each cell in this matrix represents a city. Each city in country has some enjoyment value associated with it and is equal to $A[i][j]$ where $ i , j $ represents location of the city. If $A[i][j]=-1$ then it is barren land. Ashish got $K$ opportunities to travel in Berland .During one trip he can start from any city and move
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