My code not working

#include
#include

using namespace std;

int main() {
long long n,max=0; cin>>n;
stack s;
stack m;
for(long long i=0; i<n ; i++) {
unsigned long long k; cin>>k;
if(k==1) {
unsigned long long x; cin>>x;
s.push(x);
if(x>max) max=x;
m.push(max);
}
if(k==2) {
if(!s.empty()) {
s.pop();
m.pop();
}
}
if(k==3) {
if(!m.empty())
cout<<m.top()<<"\n";
else cout<<-1;
}
}
return 0;
}

@priyamthakuria27
the way you created your stack is wrong. It should be stack s; and stack m;

you wrote the exact same thing. please check.

@priyamthakuria27
Actually I was not able to see your code properly. Please save it at http://ide.codingblocks.com/ and then share link here and also provide link of the question you are trying.

i found my error. thank you

@priyamthakuria27
Mark this doubt as resolved. Thanks