Chef and Roads
CodeChefOpen on judge ↗
Chef lives in Chefland. Chefland can be accurately represented by a certain number of intersections and the roads connecting them. Chefland is a strange place, because all the roads there are one-way. Also, for any two intersections A and B, once you travel from A to B, you can never return to A again because there is simply no route you can take to get back to A. Unaware of this, Chef set out to
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