cf/mirror

Lexicographic Partition

CF
2124I3500· legendary gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
8
3
1 2 2
2
1 1
3
1 2 1
3
1 2 3
4
1 2 2 4
4
1 2 3 3
5
1 2 3 2 3
9
1 2 3 4 5 4 5 6 6
Output
YES
1 2 3
NO
NO
YES
3 1 2
NO
YES
3 1 2 4
YES
1 4 3 5 2
YES
5 2 1 8 6 9 3 4 7
2124I.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…