cf/mirror

King's Task

CF
1510K1200· pupil3s512 MB⌨ stdin/stdout

Examples

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