Roman Routing
Salmon has time-travelled to the dying days of the Roman Empire, and needs to travel to Rome. There are $N$ cities in the Roman Empire; these are numbered from $0$ to $N-1$. City $0$ is Rome. There are also $M$ unidirectional roads between some of these $N$ cities. The $i$-th road is from city $A_i$ to city $B_i$, and has a length of $W_i$. As the old saying goes, "All roads lead to Rome". I
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