Restore the Permutation by Sorted Segments
1343F2400· grandmaster2s256 MB⌨ stdin/stdout
Examples
Sample 1of 1
Input
563 2 5 62 4 63 1 3 42 1 34 1 2 4 652 2 32 1 22 1 42 4 573 1 2 64 1 3 5 62 1 23 4 5 76 1 2 3 4 5 63 1 3 622 1 252 2 53 2 3 54 2 3 4 55 1 2 3 4 5
Output
3 1 4 6 2 53 2 1 4 52 1 6 3 5 4 71 22 5 3 4 1
58%
1343F.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)