更新s,s有两种情况,一个是s+=n,另一个是之前领过奖的不能领,s+=1
#include<iostream>
#include<string>
#include<cstring>
#include<map>
using namespace std;
int m, n, s;
bool f = false;
map<string, int>mp;
int main()
{
scanf("%d%d%d", &m, &n, &s);
getchar();
for (int i = 1; i <= m; i++)
{
string str;
getline(cin, str);
if (i == s&&mp.find(str) != mp.end())s = s + 1;
if (i == s&&mp.find(str)==mp.end())
{
mp[str] = 1;
cout <<" "<< str << endl;
f = true;
s += n;
}
}
if (f == false)printf("Keep going...\n");
return 0;
}