SDUT OJ refresh的停车场

2015-01-26 23:16:04 · 作者: · 浏览: 9

\

#include
  
   
#include
   
     using namespace std; string a[20010],b[20010]; int main() { int n,m,i,flag; string x,y; while(cin>>n>>m) { flag=0; int top=0; int top1=0; int top2=0; for(i=0;i
    
     >x; if(x=="Add") { cin>>y; if(top
     
top1) { top--; } } if(x=="Out") { if(top2>top1) { flag=1; } else { top2++; } } } if(top>0 && flag==0) { while(top>0) { cout<