cf/mirror

Minimum Path

CF
1473E2400· grandmaster3s256 MB⌨ stdin/stdout

Examples

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