这题用set可以过。。。代码如下:
#include<bits/stdc++.h>
using namespace std;
int n,m;
string str;
set<string> name1,name2;
int main(){
scanf("%d",&n);
while(n--){
cin>>str;
name1.insert(str);
}
scanf("%d",&m);
while(m--){
cin>>str;
if(name1.count(str)){
int os=name2.size();
name2.insert(str);
if(name2.size()==os) printf("REPEAT");
else printf("OK");
}else printf("WRONG");
printf("\n");
}
return 0;
}