Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156012 陈骏睿 环形密码 C++ Wrong Answer 1 MS 264 KB 665 2026-06-20 09:09:41

Tests(0/10):


Code:

#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 n,m,a[31]={0}; cin>>n>>m; for(int i=0;i<n;i++)cin>>a[i]; int cnt=0,i=0,w=0; while(cnt>n){ i++; if(a[w]!=0){ i++; if(i==m){ cnt++; m=a[w]; cout<<a[w]<<' '; a[w]=0; i=0; } } w++; if(w==n+1)w=1; } return 0; }


Run Info:

------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-----