← All problemsSign in

Elephants in a Pond

CodeChefRating 3368Open on judge ↗

Some elephants have decided to drink water from a pond. The pond may be considered a grid with $N$ rows (numbered $1$ through $N$) and $N$ columns (numbered $1$ through $N$). There are $4N$ elephants and they stand at the perimeter of the pond in such a way that there is exactly one elephant at the top and bottom of each column and at the left and right end of each row. Since elephants can only s

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