Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
116990 | 李朋秦 | 19按规则查找数组中的数据 | C++ | Accepted | 1 MS | 276 KB | 241 | 2025-04-13 10:03:50 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,a[1000],count,j=1; cin>>n>>count; for(int j=0;j<n;j++){ cin>>a[j]; } cout<<a[0]; for(int i=1;i<count;i++){ j=a[j-1]; cout<<" "<<a[j-1]; } return 0; }