UVA 11995.I Can Guess the Data Structure!
Description
There is a bag-like data structure, supporting two operations:
operation | meaning |
---|---|
1 x | Throw an element x into the bag. |
2 | Take out an element from the bag. |
Given a sequence of operations with return values, you’re going to guess the data structure. It is a stack (Last-In, First-Out), a queue (First-In, First-Out), a priority-queue (Always take out larger elements first) or something else that you can hardly imagine!
Input
There are several test cases. Each test case begins with a line containing a single integer n (1