题目链接:点击打开链接
思路:水题......
#include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
using namespace std;
set<string> se;
int main(){
int m,n,s;
string t;
scanf("%d%d%d",&m,&n,&s);
if(m < s){
printf("Keep going...\n");
return 0;
}
for(int i = 1;i <= s;i++){
cin >> t;
}
cout << t << endl;
se.insert(t);
int cnt = 0;
for(int i = 1;i <= m - s;i++){
cin >> t;
if(se.find(t) == se.end()){
cnt++;
}
if(cnt % n == 0){
cout << t << endl;
se.insert(t);
cnt = 0;
}
}
return 0;
}