Game Night
CodeChefOpen on judge ↗
There is a grid of N rows and M columns, and it is filled with red and green tiles. The tiles are labeled such that the top left tile is $(1, 1)$ and the bottom right tile is $(N, M)$. On this grid, each tile has a score. This score is equal to the minimum Manhattan distance of the tile to any red tile on the grid. In particular, the score of a red tile is always $0$. Alice and Bob are playing
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