cf/mirror

Sorting Permutations

CF
398E2s256 MB⌨ stdin/stdout

Examples

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