Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93413 | Kevin | 杀人游戏 | C++ | Accepted | 6 MS | 276 KB | 284 | 2024-10-13 20:28:08 |
#include<bits/stdc++.h> using namespace std; int main(){ queue<int>q; int n,m; cin>>n>>m; for(int i=1;i<=n;i++){ q.push(i); } while(q.size()!=1){ for(int i=1;i<m;i++){ q.push(q.front()); q.pop(); } cout<<q.front()<<" "; q.pop(); } return 0; }