분류 전체보기
-
10845) 큐 c++백준코딩일기 2020. 11. 4. 16:15
문제 ) www.acmicpc.net/problem/10845 10845번: 큐 첫째 줄에 주어지는 명령의 수 N (1 ≤ N ≤ 10,000)이 주어진다. 둘째 줄부터 N개의 줄에는 명령이 하나씩 주어진다. 주어지는 정수는 1보다 크거나 같고, 100,000보다 작거나 같다. 문제에 나와있지 www.acmicpc.net 풀이 ) c++ STL을 이용해서 풀었다. 코드 ) #include #include using namespace std; int N; string cmd; queue q; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> N ; while(N--) { cin >> cmd; int num; if( cmd =..