Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
100020 张永良 序列变换II C++ Accepted 1 MS 272 KB 293 2024-12-01 14:09:45

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ int n,w,e,r; cin>>n; int a[n],s[n]; for(int i=0;i<=n-1;i++){ cin>>a[i]; } for(int i=0;i<=n-1;i++){ w=a[i]; e=a[w-1]; r=a[e-1]; s[i]=r; } for(int i=0;i<=n-1;i++){ cout<<s[i]<<" "; } return 0 ; }