← All problemsSign in

Chef in a Mysterious Land (Challenge)

CodeChefRating 3715Open on judge ↗

Chef arrived to a mysterious land. This land consists of $N$ worlds (numbered $1$ through $N$), called *ages*. Chef can travel from an age to another one by the process of *linking*; this process is facilitated by *linking books*. Each linking book allows Chef to travel to a specific age from any age. There may be multiple linking books that link to the same age; all such books are indistinguishab

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