Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155723 陈骏睿 杀人游戏 C++ Accepted 1 MS 272 KB 525 2026-06-13 10:43:21

Tests(5/5):


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(){ bool a[101]={0}; int n,m,x=0,w=0,b=0; cin>>n>>m; while(x!=n-1){ w++; if(w>n)w=1; if(a[w]!=1)b++; if(b==m){ b=0; cout<<w<<" "; a[w]=1; x++; } } return 0; }