ABC217 C Inverse of Permutation
$ q_{p_i} = i
とすればよい. 0-indexedか, 1-indexedかに注意.
実装例:
https://atcoder.jp/contests/abc217/submissions/25560037