Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
131830 刘益梵 19按规则查找数组中的数据 C++ Accepted 1 MS 272 KB 204 2025-10-01 16:37:49

Tests(10/10):


Code:

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