← All problemsSign in

Little Elephant and Magic

CodeChefRating 2383Open on judge ↗

The Little Elephant from the Zoo of Lviv believes in magic. He has a magic board A that consists of N rows and M columns. Each cell of the board contains an integer from 0 to 9 inclusive. The cell at the intersection of the i-th row and the j-th column is denoted as (i; j), where 1 ≤ i ≤ N and 1 ≤ j ≤ M. The number in the cell (i; j) is denoted as A[i][j]. The Little Elephant owns the only magic

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