1AC,1WA,1TLE
实在找不出来了。
#include<bits/stdc++.h>
using namespace std;
int main(){
long long t;
cin>>t;
while(t--){
stack<long long> st;
string a;
long long n,m;
cin>>n;
while(n--){
cin>>a;
if(a=="push"){
cin>>m;
st.push(m);
}
if(a=="pop"){
if(st.size()!=0) st.pop();
else cout<<"Empty"<<endl;
}
if(a=="query"){
if(st.size()!=0) cout<<st.top()<<endl;
else cout<<"Anguei!"<<endl;
}
if(a=="size"){
cout<<st.size()<<endl;
}
}
}
return 0;
}
蒟蒻题解看不懂