cf/mirror

Queue Sort

CF
1899E1300· pupil1s256 MB⌨ stdin/stdout

Examples

Sample 1of 1multi-test • hover to link
Input
5
5
6 4 1 2 5
7
4 5 3 7 8 6 2
6
4 3 1 2 6 4
4
5 2 4 2
3
2 2 3
Output
2
6
-1
-1
0
1899E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)