#include <stdio.h>
#include <string.h>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;
char A[1100][30];
map<string,int> mp;
int main()
{
int N,K,st;
scanf("%d%d%d",&N,&K,&st);
for(int i=1;i<=N;i++)
{
scanf("%s",&A[i]);
}
int index=1;
bool start=false;
int step=K;
while(index<=N)
{
if(index==st)
{
start=true;
step=0;
}
if(start)
{
if(step==0)
{
if(mp.find(A[index])!=mp.end())
{
step=1;
}
else
{
printf("%s\n",A[index]);
mp[A[index]]=1;
step=K;
}
}
step--;
}
index++;
}
return 0;
}
PAT甲1124 Raffle for Weibo Followers(20 分)
最新推荐文章于 2022-10-02 20:28:49 发布
