193. Queue Operations
EasyQueue
Process commands on an empty queue: enqueue x, dequeue (print the removed value, or EMPTY), front (print the front value, or EMPTY) and size.
Input format
Line 1: q Next q lines: commands
Output format
One line per dequeue, front or size command.
Example 1
Input
6 enqueue 3 enqueue 5 front dequeue dequeue dequeue
Output
3 3 5 EMPTY
Example 2
Input
3 size enqueue 1 size
Output
0 1
Constraints
1 ≤ q ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.
Loading the MyLoginn IDE…