Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
122889 | 胡汪兵-小胡老师 | 19按规则查找数组中的数据 | C++ | Accepted | 1 MS | 280 KB | 218 | 2025-06-22 08:23:17 |
#include<bits/stdc++.h> using namespace std; int main(){ int a[1001],n,m,jg=1; cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; for(int j=1;j<=m;j++) { cout<<a[jg]<<" "; jg=a[jg]; } return 0; }