Catch Me If You Can
CodeChefOpen on judge ↗
There is a grid of size $N \times M$. Let's denote the cell at the intersection of the $i$-th row and $j$-th column as $(i, j)$. Yahor and Alex are standing on this grid — Yahor in the cell $(1, 1)$, and Alex in the cell $(N, M)$. Yahor wants to catch Alex (to stay in the same cell with him), and Alex wants to avoid this. They are moving in turns, with the following rules: * Yahor moves first. *
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