Problem Description
Loading...
Problem Analysis
Dual-weight shortest path
Need to consider two weights simultaneously
Here length is prioritized; when lengths are equal, the edge with lower cost is preferred
What is a bit troublesome is that
the logic of the previous implementation seemed to have some issues
the judgment when updating edge lengths was not rigorous enough
Fortunately, I found it in the end
Also, this type of problem
generally needs to handle multi-edges
Used Dijkstra
cpp
| |
Here is another Floyd one
but this one timed out
cpp
| |
Problem link: 【HDU】[3790]Shortest Path Problem