cf/mirror

Longest Simple Cycle

CF
1476C1600· expert2s256 MB⌨ stdin/stdout

Examples

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