cf/mirror

Parallel Swaps Sort

CF
1909H3500· legendary gm7s1024 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
5
2 5 4 1 3
Output
5
1 4
1 2
2 5
1 4
4 5
Sample 2of 3
Input
9
1 2 3 4 5 6 7 8 9
Output
0
Sample 3of 3
Input
10
6 4 2 3 8 10 9 1 5 7
Output
15
1 8
6 9
1 8
3 10
1 10
1 10
1 6
6 9
6 9
2 7
9 10
5 10
1 6
2 9
1 10
1909H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)