MLE???
查看原帖
MLE???
1343286
Mincraft_Player楼主2024/8/17 21:45

WA on #2 MLE on #3

#include<iostream>
#include<stack>
using namespace std;
stack<unsigned long long>S;
int t,n,x;string s;
int main(){
	cin>>t;
	while(t--){
		cin>>n;
		while(n--){
			cin>>s;
			if(s=="push")cin>>x,S.push(x);
			else if(s=="pop")
				if(S.empty())cout<<"Empty\n";
				else S.pop();
			else if(s=="query")
				if(S.empty())cout<<"Anguei!\n";
				else cout<<S.top()<<'\n';
			else cout<<S.size()<<'\n';
		}
		while(S.size())S.pop();
	}
	return 0;
}
2024/8/17 21:45
加载中...