Roads and Flights
The country of Cheflandia has $N$ cities, with $M$ **one-directional** roads connecting pairs of them. There are also flights between certain pairs of cities. In particular, there's a flight from city $u$ to city $v$ if and only if: - There exists a way to travel from city $u$ to city $v$ via some sequence of roads; **and** - There exists a way to travel from city $v$ to city $u$ via some sequen
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.
Sign in to chat with the tutor and save your progress.
Sign in to start