← All problemsSign in

Bunny Hops

CodeChefRating 2632Open on judge ↗

Bugs Bunny is very smart, but he keeps constantly worrying about the future and is always anxious. Therefore, he keeps hopping between towns without standing still. The place where Bugs Bunny lives has $N$ towns (numbered $1$ through $N$) with one-way roads connecting them in such a way that they form an arborescence (a tree with all paths directed from the root), rooted at town $1$. Therefore, e

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