코딩테스트/백준
2024. 9. 7.
[백준] 2164번: 카드2
🔗 문제 링크https://www.acmicpc.net/problem/2164👩💻 코드#include #include using namespace std;int main(){ ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int N; cin >> N; queue q; for(int i=1; i 1){ q.pop(); int f = q.front(); q.pop(); q.push(f); } cout 📝 풀이큐의 선입선출 성질을 이용하면 간단히 풀 수 있습니다.1부터 N까지의 숫자 카드를 큐에 push 합니..