https://vjudge.net/problem/UVA-12207
诡异,文件输出过不了,
q.clear()写成while(!q.empty())q.pop_front()过不了
#include<iostream>
#include<cstdio>
#include<deque>
#include<cstring>
#include<fstream>
using namespace std;
ofstream out;
deque<int> q;
char in[10];
int main(){
int n,c,ca,a,i;
while(scanf("%d%d",&n,&c),n||c){
printf("Case %d:\n",++ca);
q.clear();
for(i=1;i<=n&&i<=1000;i++)
q.push_back(i);
while(c--){
scanf("%s",in);
if(!strcmp(in,"N")){
cout<<q.front()<<endl;
q.push_back(q.front());
q.pop_front();
}else if(strcmp(in,"E")==0){
scanf("%d",&a);
deque<int>::iterator it;
for(it=q.begin();it!=q.end();it++)
if((*it)==a){
q.erase(it);
break;
}
q.push_front(a);
}
}
}
}