-->
当前位置:首页 > 题库

PROGRAMMING:Stack

Luz5年前 (2021-05-10)题库447
We know that a trivial stack has several operations:
Push (value) pushes value onto the stack
Pop () pops up the top of the stack element and returns the element that pops up.
Now we want to implement the following operations based on the trivial stack:
Push (VAL) to push Val into the stack;
Pop() pops up the top of the stack;
Min () returns the minimum value of the element in the stack.
###Input format:
In the first line, enter an n (0 = < n < = 1000000), which means there are n lines of operations.
Next N lines, each line has an operation to ensure that the operation will not cross the boundary
###Output format:
Output the result of each query min (), pop () does not output
###Input example:
```in
six
push 1
min
push 2
min
push 3
min
```
###Output example:
```out
one
one
one
```







answer:If there is no answer, please comment