首页 > 其他 > 详细

1124 Raffle for Weibo Followers

时间:2020-03-18 17:37:06      阅读:50      评论:0      收藏:0      [点我收藏+]

英文版题目:https://pintia.cn/problem-sets/994805342720868352/problems/994805350803292160

中文版题目:https://pintia.cn/problem-sets/994805260223102976/problems/994805265159798784

 1 #include<iostream>
 2 #include<vector>
 3 #include<unordered_map>
 4 using namespace std;
 5 
 6 
 7 int main() {
 8     int m,n,s;
 9     cin>>m>>n>>s;
10     vector<string> vs(m+1);
11     unordered_map<string,bool> mp;
12     for(int i = 1; i <= m; ++i) {
13         cin>>vs[i];
14         mp[vs[i]] = false;
15     }
16     if(s > m) printf("Keep going...");
17     else {
18         while(s <= m) {
19             while(s <= m&&mp[vs[s]])
20                 s++;
21             if(s <= m) {
22                 mp[vs[s]] = true;
23                 printf("%s\n",vs[s].c_str());
24                 s += n;
25             }
26         }
27     }
28     return 0;
29 }

技术分享图片

 

1124 Raffle for Weibo Followers

原文:https://www.cnblogs.com/keep23456/p/12518360.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!