Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
95978 | 孙嘉言 | 杀人游戏 | C++ | Accepted | 1 MS | 268 KB | 345 | 2024-11-02 16:42:09 |
#include <iostream> #include <cstring> #include <cmath> using namespace std; bool a[1001]={0}; int n,m,i,f=0,t=0,s=0; int main(){ cin>>n>>m; while(f!=n-1){ t++; if(t>n) t=1; if(!a[t]) s++; if(s==m){ s=0; cout<<t<<' '; a[t]=1; f++; } }cout<<endl; return 0; }