1124 Raffle for Weibo Followers (20 分)

水~。

const int N=1010;
string a[N];
unordered_set<string> S;
int n,step,idx;

int main()
{
    cin>>n>>step>>idx;

    for(int i=1;i<=n;i++) cin>>a[i];

    for(int i=idx;i<=n;)
    {
        if(S.count(a[i])) i++;
        else
        {
            cout<<a[i]<<endl;
            S.insert(a[i]);
            i+=step;
        }
    }

    if(S.size() == 0) puts("Keep going...");
    
    //system("pause");
    return 0;
}
posted @ 2021-03-06 11:57  Dazzling!  阅读(20)  评论(0编辑  收藏  举报