| 1 | struct min_stack { |
| 2 | stack<int> S, M; |
| 3 | void push(int x) { |
| 4 | S.push(x); |
| 5 | M.push(M.empty() ? x : min(M.top(), x)); } |
| 6 | int top() { return S.top(); } |
| 7 | int mn() { return M.top(); } |
| 8 | void pop() { S.pop(); M.pop(); } |
| 9 | bool empty() { return S.empty(); } }; |
| 10 | struct min_queue { |
| 11 | min_stack inp, outp; |
| 12 | void push(int x) { inp.push(x); } |
nothing calls this directly
no outgoing calls
no test coverage detected