cf/mirror

Path Queries

CF
1213G1800· expert3s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
7 5
1 2 1
3 2 3
2 4 1
4 5 2
5 7 4
3 6 2
5 2 3 4 1
Output
21 7 15 21 3
Sample 2of 3
Input
1 2
1 2
Output
0 0
Sample 3of 3
Input
3 3
1 2 1
2 3 2
1 3 2
Output
1 3 3
1213G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…