纯暴力但AC
#include<iostream>
using namespace std;
#define ll long long
ll n, m;
struct word {
string name;
ll time;
} w[10005];
int find(string s);
int main() {
string s;
cin >> n;
for(int i=1; i<=n; i++) {
cin >> w[i].name;
}
cin >> m;
for(int i=1; i<=m; i++) {
cin >> s;
int flag=find(s);
if(flag) {
if(w[flag].time==0) {
cout << "OK" << endl;
w[flag].time++;
} else {
cout << "REPEAT" << endl;
}
} else {
cout << "WRONG" << endl;
}
}
return 0;
}
int find(string s) {
for(int i=1; i<=n; i++) {
if(s==w[i].name) {
return i;
}
}
return 0;
}