文章
68
粉丝
691
获赞
26
访问
582.3k
int main() {
int n, M; string s;
while (cin >> n) {
map<string, int>m;
for (int i = 0; i < n; i++) {
cin >> s; m[s] = 0;
}
cin >> M;
for (int i = 0; i < M; i++) {
cin >> s;
if (m.find(s) != m.end()) {
if (m[s] == 0) {
m[s]++; cout << "OK" << endl;
}
else cout << "REPEAT" << endl;
}
else
cout << "WRONG" << endl;
}
}
}
登录后发布评论
map过不了的,它的常数很大,要用字典树