1399: 队列练习 3

Memory Limit:128 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:347 Solved:248

Description

比起第一题,本题加了另外一个操作,访问队头元素(编号3,保证访问队头元素时或出队时队不为空),现在给出这N此操作,输出结果。

Input

N
N次操作(1入队 2出队 3访问队头)

Output

K行(K为输入中询问的个数)每次的结果

Sample Input Copy

6
1 7
3
2
1 9
1 7
3

Sample Output Copy

7
9

HINT

对于50%的数据 N≤1000 入队元素≤200
对于100%的数据 N≤100000入队元素均为正整数且小于等于10^4

加入题单

算法标签: