#abc217c. C - Inverse of Permutation
C - Inverse of Permutation
Score : points
问题描述
我们将长度为 的序列,其中每个 各出现一次,称为长度为 的排列。
给定一个长度为 的排列 ,输出一个满足以下条件的长度为 的排列 。
- 对于每一个 , 中的第 个元素为 。
可以证明存在唯一一个满足条件的 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
We will call a sequence of length where each of occurs once as a permutation of length .
Given a permutation of length , , print a permutation of length , , that satisfies the following condition.
- For every , the -th element of is .
It can be proved that there exists a unique that satisfies the condition.
Constraints
- is a permutation of length (defined in Problem Statement).
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the sequence in one line, with spaces in between.
Sample Input 1
3
2 3 1
Sample Output 1
3 1 2
The permutation satisfies the condition, as follows.
- For , we have .
- For , we have .
- For , we have .
Sample Input 2
3
1 2 3
Sample Output 2
1 2 3
If for every , we will have .
Sample Input 3
5
5 3 2 4 1
Sample Output 3
5 3 2 4 1
update @ 2024/3/10 09:36:41