Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
93414 hby 杀人游戏 C++ Accepted 1 MS 276 KB 328 2024-10-13 20:29:35

Tests(5/5):


Code:

# include<bits/stdc++.h> using namespace std; int main(){ int m,n,a=0; queue <int> q; cin>>n>>m; for(int i=1;i<=n;i++){ q.push(i); } while(q.empty()==false){ for(int i=1;i<m;i++){ q.push(q.front()); q.pop(); }if(q.size()==1){ break; } cout<<q.front()<<" "; q.pop(); } return 0; }