Police And Theif
CodeChefOpen on judge ↗
Chefland is a country in which there are $N$ cities connected by $N$-1 two-way road such that it's possible to get from any city to any other city. One day a thief broke in a city $A$ and the policeman of the chefland is in city $B$. If two cites $X$ and $Y$ are connected by the direct road then it will take W amount of time to travel between them. Theif can travel a city only once (if he leave
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