不开ull为什么会超时
查看原帖
不开ull为什么会超时
1515308
mfy123楼主2025/1/13 10:05

不开unsigned最后不应该是wa吗?为什么最后一个点超时了

#include<bits/stdc++.h>
using namespace std;
#define int unsigned long long
signed main()
{
int t;
cin>>t;

while(t--)
{
    stack<int>st;
    int n;
    cin>>n;
    while(n--)
    {
string s;
cin>>s;
if(s=="push")
{
    int k;
    cin>>k;
    st.push(k);
}
else if(s=="query")
{
    if(!st.empty())
    cout<<st.top()<<'\n';
    else
    cout<<"Anguei!"<<'\n';

}
else if(s=="size")
{
cout<<st.size()<<'\n';
}
else if(s=="pop")
{
if(st.empty())
cout<<"Empty"<<'\n';
else st.pop();
}
    }
}
    return 0;
}
2025/1/13 10:05
加载中...