本文共 2352 字,大约阅读时间需要 7 分钟。
6in 874queryoutin 24622in 12194query
Case #1:87424622
/*超时 #include#include #include using namespace std;const int N=10000+10;int a[N],b[N];int len,now;string s;int c;int main(){ int n,t=1; while(cin>>n){ len=0; now=0; cout<<"Case #"< <<":"< >s; if(s=="in"){ cin>>c; a[len++]=c; }else if(s=="out"){ now++; }else if(s=="query"){ int ll=0; for(int i=now;i #include #include using namespace std;const int N=10000+10;int a[N],b[N];int len,now;string s;int c;int main(){ int n,t=1; while(scanf("%d",&n)==1){ len=0; now=0; printf("Case #%d:\n",t++); while(n--){ cin>>s; if(s=="in"){ scanf("%d",&c); a[len++]=c; }else if(s=="out"){ now++; }else if(s=="query"){ int ll=0; for(int i=now;i #include #include #include #include using namespace std;const int maxn=10000+10;int num[maxn];int bcnt;int add(int t){ int i; int flash=0,k; if(bcnt==0) { num[++bcnt]=t; return 0; } if(num[bcnt]