[백준/Python] 10845번 - 큐
·
Algorithm/BaekJoon
import sys from collections import deque input = sys.stdin.readline q = deque() for _ in range(int(input())): command = input().rstrip() if command == "pop": print(-1 if len(q) == 0 else q.popleft()) elif command == "size": print(len(q)) elif command == "empty": print(+(not q)) elif command == "front": print(-1 if len(q) == 0 else q[0]) elif command == "back": print(-1 if len(q) == 0 else q[-1])..