Road Construction
1252L2300· international master2s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
4 52 2 1 23 2 2 34 2 3 42 2 4 51 2 3 4 5
Output
1 22 33 40 04 2
Sample 2of 2
Input
4 52 2 10 203 2 2 34 2 3 42 2 4 51 2 3 4 5
Output
-1
58%
1252L.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…