啊这。。。
查看原帖
啊这。。。
658786
STUDENT00楼主2022/10/12 20:55

这题用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;
}
2022/10/12 20:55
加载中...