提交时间:2023-01-01 15:09:56
运行 ID: 3326
#include<iostream> #include<algorithm> #include<cstdio> #include<queue> #include<stack> #include<cstring> using namespace std; int main(){ int n; cin>>n; queue<int> q; for(int i=1;i<=n;i++)q.push(i); while(q.size()>1){ for(int i=1;i<3;i++){ q.push(q.front()); q.pop(); } q.pop(); } cout<<q.front(); return 0; } /* #include<cstdio> freopen("文件名.in","r",stdin); freopen("文件名.out","w",stdout); */