最后flag如果依然是false说明要输出Keep going… 代码 #include<bits/stdc++.h>using namespacestd;intm,n,s;vector<string> a;map<string,bool> mp;intmain(){scanf("%d%d%d",&m,&n,&s); a.resize(m+1);for(inti=1;i<=m;i++){cin>>a[i]; }boolflag =0;for(inti=s;i<=m;i+=n){if...
1#defineHAVE_STRUCT_TIMESPEC2#include<bits/stdc++.h>3usingnamespacestd;4strings[1007];5stringans[1007];6map<string,int>mp;7intmain(){8ios::sync_with_stdio(false);9cin.tie(NULL);10cout.tie(NULL);11intm,n,k;12cin>>m>>n>>k;13for(inti=1;i<=m;++i)14cin>>s[i];15intcnt=0...
#include #include<vector> #include<queue> #include<string> usingnamespacestd; //map,注意重复抽奖和map intmain(){ intm,n,s; scanf("%d%d%d",&m,&n,&s); //共m人,n人抽一个,从第s个开始抽 stringstr; map<string,int>mapp; boolflag=false; for(inti=1;i<=m;i++){ cin>>str; if...
1124 Raffle for Weibo Followers (20 point(s)) John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give away gifts. Now you are suppo...
John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give away gifts. Now you are supposed to help him generate the list of winners. ...
二、参考代码 #include<iostream>#include<string>#include<set>usingnamespacestd; set<string> sname; string name[1010];intmain(){intm, n, s;scanf("%d%d%d", &m, &n, &s);for(inti =1; i <= m; i++){// scanf("%s", name[i]);cin >> name[i]; ...
PAT (Advanced Level) Practice 1124 Raffle for Weibo Followers (20 分) 凌宸1642 题目描述: John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post...
PAT 1124 Raffle for Weibo Followers 1.题意 输入:数字m,n,s,一串人名。 第s个为获奖的人,则s+n 为下一个获奖的人,如果此人已经获奖,那么则往后顺移一位。 输出:获奖人的名单。【按照获奖的顺序】 2.分析 使用LinkedHashSet保存获奖人的名单,这样不仅可以去重,而且可以保持顺序。
1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from...
PAT甲级——A1124 Raffle for Weibo Followers John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N followers who forwarded his post, and give away gifts. Now you are supposed ...