Permutation and Queries
1619H2400· grandmaster4s256 MB⌨ stdin/stdout
Examples
Sample 1of 2
Input
5 45 3 4 2 12 3 12 1 21 1 32 1 2
Output
412
Sample 2of 2
Input
5 92 3 5 1 42 3 52 5 52 5 12 5 32 5 41 5 42 5 32 2 52 5 1
Output
35423331
58%
1619H.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)