Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
140075 刘梓含 19按规则查找数组中的数据 C++ Accepted 0 MS 284 KB 242 2025-12-13 15:11:30

Tests(10/10):


Code:

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