Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
87817 | 常仕铎 | 报数 | C++ | Accepted | 1 MS | 272 KB | 437 | 2024-08-15 09:58:05 |
#include<bits/stdc++.h> using namespace std; int n,faction=1; int main(){ queue<int> myQueue; cin>>n; for(int i=1;i<=n;i++) myQueue.push(i); while(myQueue.size()!=1){ if(faction!=3){ myQueue.push(myQueue.front()); myQueue.pop(); faction++; } else{ myQueue.pop(); faction=1; } } cout<<myQueue.front(); }