Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
96311 吴诗涵 19按规则查找数组中的数据 C++ Runtime Error 1 MS 272 KB 236 2024-11-03 19:25:13

Tests(0/10):


Code:

#include<iostream> using namespace std; int main(){ int n,m; cin>>n; cin>>m; int ai[101]={0}; for(int i=0;i<n;i++){ cin>>ai[i]; } cout<<ai[0]<<" "; for(int i=1;i<m;i++){ cout<<ai[ai[i-1]-1]<<" "; } return 0; }


Run Info:

Runtime Error:Segmentation fault