Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113090 | 王馨桐 | 环形密码 | C++ | Wrong Answer | 1 MS | 276 KB | 420 | 2025-03-15 11:43:42 |
#include<bits/stdc++.h> using namespace std; int N,M; int ren=0,bs=0; int live=0; int die[1001]; int a[31]; int main(){ cin >>N>>M; for(int i=1; i<=N; i++){ cin >>a[i]; } live=N+1; while(live!=1){ ren++; if(ren>N){ ren=1; } if(die[ren]==1){ continue; } bs++; if(bs==M){ cout <<ren <<" "; die[ren]=1; bs=0; live--; M=a[ren]; } } return 0; }
------Input------
10 3 8 3 6 3 4 10 3 10 3 2
------Answer-----
6 3 3 10 8 3 3 2 10 4
------Your output-----
3 9 2 6 1 7 4 10 8 5