题解 | 【模板】队列操作 | Python
【模板】队列操作
https://www.nowcoder.com/practice/1137c8f6ffac4d5d94cc1b0cb08723f9
n=int(input())
nums=[]
for _ in range(n):
k=list(map(int,input().split()))
op=k[0]
if op==1:
nums.append(k[1])
elif op==2:
if len(nums)==0:
print('ERR_CANNOT_POP')
else:
nums.pop(0)
elif op==3:
if len(nums)==0:
print('ERR_CANNOT_QUERY')
else:
print(nums[0])
else:
print(len(nums))
#python#
