#include <iostream> using namespace std; const int N = 1000010; int n, tt, stk[N], tt2, m[N]; // 1 int main() { ios::sync_with_stdio(false); cin.tie(0); cin >> n; for (; n --;) { string s; cin >> s; int x; if (s == "push") { cin >> x; stk[++ tt] = x; // 2 if (!tt2 || x <= ...