cf/mirror

Square Root of Permutation

CF
612E2200· master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
4
2 1 4 3
Output
3 4 2 1
Sample 2of 3
Input
4
2 1 3 4
Output
-1
Sample 3of 3
Input
5
2 3 4 5 1
Output
4 5 1 2 3
612E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)
loading graph engine…