cf/mirror

Shortest Path Problem?

CF
845G2300· international master3s512 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
3 3
1 2 3
1 3 2
3 2 0
Output
2
Sample 2of 2
Input
2 2
1 1 3
1 2 3
Output
0
845G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…