Skip to main content

Practice · 3 of 3

Bridge Tolls

CHALLENGE
Difficulty: advanced+25 XP

**Problem.** Directed graph, tolls on arcs. Print the minimum total toll from city 1 to city n. **Constraints:** 1 <= n <= 100000; 0 <= m <= 200000; tolls <= 1e9; n is always reachable. Hop-counting BFS is the classic near-miss.

Back to lesson: Practice: Mixed Drill — Structures and Graphs