Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
104741 万隽宇 杀人游戏 C++ Accepted 1 MS 268 KB 572 2025-01-09 19:27:17

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