| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 139171 | 冯诚阳 | 环形密码 | C++ | Wrong Answer | 0 MS | 272 KB | 674 | 2025-12-01 20:58:59 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[101],n,m,s=0,num=0; cin>>n>>m; for(int i=1;i<=n;i++) cin>>a[i]; int j=1; while(s<n){ if(a[j]!=0){ num++; if(num==m){ cout<<a[j]<<" "; a[j]=0; num=0; s++; } } j++; if(j>n) j=1; } 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-----
6 10 3 3 3 8 10 4 2 3