请问大佬们这题为何RE???
查看原帖
请问大佬们这题为何RE???
529977
Soaring_light楼主2022/4/21 21:32

RT,调了四十分钟了,一直re,求助路过的大佬们

#include<bits/stdc++.h>
using namespace std;
stack<int>a;
stack<int>b;
int n,w,ww;
int main(){
  cin>>n;
  while(n--){
  	cin>>w;
  	if(w==0){
  		cin>>ww;
  		a.push(ww);
  		if((ww>b.top())||b.empty()) b.push(ww);
  		else b.push(b.top());
  	}else{
  		if(w==1){
  			a.pop();
  			b.pop();
  		}else{
  			if(b.empty())cout<<0<<endl;
  			else cout<<b.top()<<endl;
  		}
  	}
  }
  return 0;
} 
```
2022/4/21 21:32
加载中...