Welcome   HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online
Home
FAQs
Problem Set
Practices
Online Contests
Major Exercises
OI Special
Judgement
Submit
Online Status
User Ranklist
Users
Register new
Login
Web Links
Hunan Normal University
College of Information Science and Engineering
队列之操作
Time Limit: 3000ms, Special Time Limit:6000ms, Memory Limit:32768KB
Total submit users: 42, Accepted users: 35
Problem 11529 : No special judgement
Problem description
  给定一个32位整数队列,3种操作,分别是:
push x:将x入队,加入队尾;
pop:出队,队首元素离开队列;
front:取队首元素的值。
队列内元素总数不超过100000个,初始时队列为空。

Input
  输入有若干个案例,每个案例有若干行。每个案例的第1行是一个整数n,表示操作数量;其后n行表示操作。

Output
  每个案例首先输出序号(见样例,Case与冒号无空格,冒号与序号空一格,序号后无空格)。然后对于pop操作,如果恰好当时队列为空则输出EMPTY,否则无需输出;对于front操作,如果当时队列为空则输出EMPTY,否则输出队首元素的值。

Sample Input
3
pop
push 100
front
Sample Output
Case: 1
EMPTY
100
Submit   Clarifications   Judge Status  Problems  Ranklist 

HUNAN NORMAL UNIVERSITY ACM/ICPC Judge Online, Version 2010.5.5.final.
Web visits:18370 today,16241361 total, since 2010-05-07