Problems > Inverse Permutation

Inverse Permutation

Difficulty: 900 3000 ms 128 MB

implementation

The permutation P sends position i to value Pi. Print its inverse: the permutation Q with Q[Pi] = i.

Input: the first line has N; the second line has a permutation of 1..N.

Output: the inverse permutation.

Constraints:

  • 1 ≤ N ≤ 105

Sample Tests

Input 1
4
2 4 1 3
Output 1
3 1 4 2
Input 2
1
1
Output 2
1

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.