Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
94873 | 李禹宸 | 19按规则查找数组中的数据 | C++ | Runtime Error | 1 MS | 272 KB | 252 | 2024-10-26 14:55:49 |
#include<iostream> using namespace std; int main(){ int n,a[100]={},m,j=1; cin>>n>>m; for(int i=0;i<n;i++){ cin>>a[i]; } cout<<a[0]<<" "; for(int i=1;i<m;i++){ j=a[j-1]; printf("%d\n",a[j-1]); } cout<<endl; return 0; }
Runtime Error:Segmentation fault