cf/mirror

Permutation

CF
137B1000· newbie2s256 MB⌨ stdin/stdout
#greedy

Examples

Sample 1of 3
Input
3
3 1 2
Output
0
Sample 2of 3
Input
2
2 2
Output
1
Sample 3of 3
Input
5
5 3 3 3 1
Output
2
137B.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)