| 11 | min_stack inp, outp; |
| 12 | void push(int x) { inp.push(x); } |
| 13 | void fix() { |
| 14 | if (outp.empty()) while (!inp.empty()) |
| 15 | outp.push(inp.top()), inp.pop(); } |
| 16 | int top() { fix(); return outp.top(); } |
| 17 | int mn() { |
| 18 | if (inp.empty()) return outp.mn(); |