백준 18258 파이썬
[백준 알고리즘] 18258번 큐 2, 파이썬(python)
[백준 알고리즘] 18258번 큐 2, 파이썬(python)
2021.08.1018258, 큐 2 📁 문제 출처 https://www.acmicpc.net/problem/18258 💡 생각 deque 사용 🛠 나의 코드 from collections import deque import sys input = sys.stdin.readline n = int(input()) queue = deque() for i in range(n): data = input().split() if data[0] == 'push': queue.append(data[1]) elif data[0] == 'pop': if queue: print(queue.popleft()) else: print(-1) elif data[0] == 'size': print(len(queue)) elif data[0] == 'e..