Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61403 王嘉瑜 序列变换II C++ Accepted 1 MS 268 KB 275 2023-12-08 22:57:11

Tests(10/10):


Code:

#include <iostream> using namespace std; const int N = 105; int n; int a[N],b[N]; int main(){ cin >> n; for(int i=1; i<=n; i++) cin>>a[i]; for(int i=1;i<=n;i++) b[i] = a[a[a[i]]]; for(int i=1;i<=n;i++) cout<<b[i]<<' '; return 0; }