← All problemsSign in

Convenient Airports

CodeChefRating 2300Open on judge ↗

Chefland is a big nation which relies on its airport system to guarantee fast travel. Currently, there are $N$ airports (numbered $1$ through $N$) and $M$ bidirectional flights in Chefland. Each flight connects two distinct airports, but there may be any number of flights between each pair of airports. We say that a system of flights is connected if it is possible to travel from each airport to al

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