링크 : https://www.acmicpc.net/problem/2164
#include <iostream>
#include <queue>
#include <string>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
queue<int> q;
int num = 0;
cin >> num;
for(int i = 1; i < num+1; i++){
q.push(i);
}
while(q.size() != 1){
q.pop();
q.push(q.front());
q.pop();
}
cout << q.front();
return 0;
}