cf/mirror

Cyclic Shifts Sorting

CF
1374F2400· grandmaster2s256 MB⌨ stdin/stdout

Examples

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