Road Trip
CodeChefOpen on judge ↗
You are very excited to go to your home town after winning the `ICPC` competition in the city Konohagakure. As the winning prize, you got one voucher which you can use to reduce the price of a flight to half. There is a total of $N$ cities numbered from $1$ to $N$ and a total of $M$ flights are available to travel from one city to another. City $1$ is Konohagakure and city $N$ is your hometown. Yo
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