#CCBCHBAHAI0000086. Build Array from Permutation
Build Array from Permutation
Build Array from Permutation
Source: LeetCode
Version: Phuoc Hung OJ Extended
Problem
You are given a zero-based permutation of .
Construct an array of length such that for every ,
Because is a permutation, every is a valid index of .
Input
The first line contains . The second line contains a permutation of .
Output
Print on one line.
Subtask
Subtask 1 (20 points): .
Subtask 2 (30 points): .
Subtask 3 (50 points): .
Example
Input
6
0 2 1 5 3 4
Output
0 1 2 4 5 3
Explanation
The result follows directly from the mathematical definition above.