Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156015 任艺宸 环形密码 C++ Time Limit Exceeded 1000 MS 268 KB 651 2026-06-20 09:14:27

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){ 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; }