JosephLand
Nick lives in a country named JosephLand. JosephLand consists of N cities. City 1 is the capital city. There are N - 1 directed roads. It's guaranteed that it is possible to reach capital city from any city, and in fact there is a unique path from any city to the capital city. Besides, you can't cross roads for free. To pass a road, you must have a ticket. There are total M tickets. You can not h
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