cf/mirror

By the Assignment

CF
2135C2000· candidate master4s512 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
4 4 4
-1 -1 -1 -1
1 2
2 3
1 3
4 3
5 6 7
2 2 -1 2 2
1 2
1 3
1 4
2 5
3 5
4 5
7 8 9
-1 -1 -1 -1 0 -1 0
1 2
2 3
3 4
1 4
1 5
5 6
7 6
7 5
5 8 1000000000
1 2 3 4 -1
1 2
3 2
3 5
5 1
2 4
4 3
2 5
1 4
5 4 1000000000
-1 2 -1 3 -1
1 2
1 3
2 4
2 5
Output
4
1
9
0
747068572
2135C.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…