PTA 1069 微博转发抽奖 (c++)
作者:互联网
1069 微博转发抽奖 (20 分)
#include<map>
#include<string>
using namespace std;
int main()
{
int n,m,s;
scanf("%d%d%d",&m,&n,&s);
if(s>m)
{
printf("Keep going...\n");
return 0;
}
string ss;
map<string,int>p;
for(int i=1;i<=m;i++)
{
cin>>ss;
if(p[ss]==1)
s++;
if(!(i-s)&&!p[ss])
{
s=i+n;
cout<<ss<<endl;
p[ss]++;
}
}
}
标签:1069,ss,d%,c++,int,微博,include 来源: https://blog.csdn.net/qq_44622401/article/details/99689333