cf/mirror

Shortest Paths

CF
2214E1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
2 1
1 2 1
Output
1
Sample 2of 3
Input
5 5
1 2 7
1 3 4
1 4 9
2 3 6
3 4 2
Output
7
4
6
-1
Sample 3of 3
Input
5 6
1 5 2
2 1 6
3 4 2
4 2 9
5 3 7
2 3 4
Output
6
9
12
2
2214E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…