Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
113095 | 邹昊辰 | 环形密码 | C++ | Accepted | 1 MS | 284 KB | 417 | 2025-03-15 11:44:31 |
#include<bits/stdc++.h> using namespace std; int n,m; int h=0; int s[1001],f[1001];//if s==0 h/if s==1 s int bs=0,ren=0; int main() { cin>>n>>m; for(int j=1;j<=n;j++){ cin>>f[j]; } h=n; while(h!=0) { ren++; if(ren>n) { ren=1; } if(s[ren]==1) { continue; } bs++; if(bs==m) { bs=0; s[ren]=1; h--; m=f[ren]; cout<<m<<" "; } } return 0; }