Square Root of Permutation
612E2200· master2s256 MB⌨ stdin/stdout
Examples
Sample 1of 3
Input
42 1 4 3
Output
3 4 2 1
Sample 2of 3
Input
42 1 3 4
Output
-1
Sample 3of 3
Input
52 3 4 5 1
Output
4 5 1 2 3
58%
612E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…