为什么re?
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<ctime>
#include<iomanip>
using namespace std;
int main(){
string t[3],o[5],c[5],s;
bool flag=false,pg[5]={false,false,false,false,false};
int n,index=0,cf=0;
cin>>n;
cin>>t[0]>>t[1]>>t[2];
cin>>o[0]>>o[1]>>o[2]>>o[3]>>o[4];
getline(cin,s);
while(n--){
getline(cin,s);
for(int i=0;i<3;i++){
if(t[i]+" came!"==s){
flag=true;
cf++;
break;
}
}
for(int i=0;i<3;i++){
if(t[i]+" left!"==s){
cf--;
if(!cf)flag=false;
break;
}
}
for(int i=0;i<5;i++){
if(o[i]+" started playing games!"==s){
pg[i]=true;
break;
}
}
for(int i=0;i<5;i++){
if(o[i]+" stopped playing games!"==s){
pg[i]=false;
break;
}
}
for(int i=0;i<5;i++){
if(flag&&pg[i]){c[index++]=o[i];pg[i]=0;}
}
}
sort(c,c+index);
for(int i=0;i<index;i++){
cout<<c[i]<<' ';
}
if(index==5){
cout<<"\nHow Bad Oiers Are!";
}
if(index==0){
cout<<"How Good Oiers Are!";
}
return 0;
}
请勿直接提供AC代码,请指出我代码要改的地方,如果我的思路有误,请提供具体思路+参考AC程序