题解 | 【模板】队列操作
【模板】队列操作
https://www.nowcoder.com/practice/1137c8f6ffac4d5d94cc1b0cb08723f9
que, n = [], int(input().strip())
for _ in range(n):
a = list(map(int, input().strip().split(" ")))
if a[0] == 1:
que.append(a[1])
elif a[0] == 2:
print("ERR_CANNOT_POP") if not que else que.pop(0)
elif a[0] == 3:
print("ERR_CANNOT_QUERY" if not que else que[0])
elif a[0] == 4:
print(len(que))
