#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+10;
int st[N], idx, mx[N];
int main(){
int m, op, x;
cin >> m;
while(m-- && cin >> op){
if(op == 0){
cin >> x;
st[++idx] = x;
mx[idx] = x;
mx[idx] = max(mx[idx], mx[idx-1]);
}
if(op == 1){
if(idx >= 1) idx--;
}
if(op == 2){
if(idx == 0){
cout << "0\n";
}else{
cout << mx[idx] << '\n';
}
}
}
return 0;
}
kedap0701 进货1
最新推荐文章于 2024-09-06 10:38:06 发布