← All problemsSign in

Sereja and Snake

CodeChefRating 3553Open on judge ↗

This problem is about the classical video game, called Snake. We ask you to solve the simplified version of the game. The rules are quite simple and natural, but they will be described here formally. You are given a rectangular field of N rows and M columns. Cells in this field are identified by their coordinates. (X, Y) is co-ordinate of a cell in this field if 0 ≤ X ≤ N-1 and 0 ≤ Y ≤ M-1, wh

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start