cf/mirror

Transitive Graph

CF
1900E2100· master3s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
3
5 6
2 2 4 1 3
1 2
1 3
2 4
3 4
4 5
5 2
7 7
999999999 999999999 999999999 999999999 1000000000 999999999 1000000000
1 2
2 3
3 4
4 1
4 5
4 6
6 7
14 22
2 3 5 7 3 4 1 4 3 4 2 2 5 1
1 2
2 3
2 4
3 1
4 4
4 5
5 6
5 6
5 12
6 7
6 8
7 5
7 7
7 9
8 4
9 11
10 9
11 10
11 10
12 13
13 14
14 12
Output
5 12
6 5999999995
11 37
1900E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…