Shortest Cycle
1205B1900· candidate master1s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
43 6 28 9
Output
4
Sample 2of 3
Input
55 12 9 16 48
Output
3
Sample 3of 3
Input
41 2 4 8
Output
-1
58%
1205B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…