标签:
#include<cstdio> #include<iostream> #include<queue> using namespace std; int n,k,a,t=1; int main() { queue<int>line; cin>>n; while(n--) { cin>>k; if(k==1) { cin>>a; line.push(a); } if(k==2) { if(line.empty()) { //cout<<"impossible!"<<endl; //return 0; t=0; continue; } line.pop(); } } if(line.empty()||t==0) cout<<"impossible!"<<endl; else cout<<line.front()<<endl; return 0; }
标签:
原文地址:http://www.cnblogs.com/babyyang/p/5285645.html