cf/mirror

Minimize Inversions

CF
1918B900· newbie2s256 MB⌨ stdin/stdout

Examples

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