cf/mirror

Shortest Cycle

CF
1205B1900· candidate master1s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4
3 6 28 9
Output
4
Sample 2of 3
Input
5
5 12 9 16 48
Output
3
Sample 3of 3
Input
4
1 2 4 8
Output
-1
1205B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…