Chef and Buses
CodeChefOpen on judge ↗
Chef and his girlfriend are visiting Rizen city. This city has a peculiar bus service. The road network used by the buses forms a tree. All buses shuttle to and fro between one common station (root) and one other station (a leaf ) . The buses stop at all stations that are in its path. Also all buses use the shortest path (from the bus road network) to transit between it’s start and end stations. C
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