| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 62302 | 余慕涵 | 19按规则查找数组中的数据 | C++ | Accepted | 1 MS | 284 KB | 343 | 2023-12-22 21:00:07 |
#include <iostream> #include <cstdio> using namespace std; int main(){ int t,f=0,y=0,n,j,m; cin>>n; int l[n+1]; cin>>m; for (f=1;f<=n;f++) cin>>l[f]; j=l[1]; cout<<j; for (f=1;f<m;f++){ cout<<" "<<l[j]; j=l[j];} return 0; }