cf/mirror

Restoring Permutation

CF
1315C1200· pupil1s256 MB⌨ stdin/stdout
#greedy

Examples

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