题意:水题,直接贴代码了。(为什么我第一遍做的时候代码写的那么烦?)

代码:

  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <map>
  5. #include <fstream>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10. //ifstream cin("pat.txt");
  11. int forwardCnt,step,start;
  12. cin>>forwardCnt>>step>>start;
  13. string name;
  14. vector<string> vec(forwardCnt),win;
  15. map<string,int> mp;//标记已获奖的人
  16. int skip=step;
  17. ;i<forwardCnt;i++)
  18. cin>>vec[i];
  19. if(start>vec.size()) cout<<"Keep going...";
  20. else{
  21. ;//从第一个中奖者开始
  22. while(i<vec.size()){
  23. string query=vec[i];
  24. ){//该用户在此前还没有获过奖
  25. win.push_back(query);
  26. mp[query]=;
  27. i+=step;
  28. }else{
  29. i++;
  30. }
  31. }
  32. for(auto it:win)//可以用C++11,方便
  33. cout<<it<<'\n';
  34. }
  35. ;
  36. }

1124 Raffle for Weibo Followers的更多相关文章

  1. PAT 1124 Raffle for Weibo Followers

    1124 Raffle for Weibo Followers (20 分)   John got a full mark on PAT. He was so happy that he decide ...

  2. 1124 Raffle for Weibo Followers (20 分)

    1124 Raffle for Weibo Followers (20 分) John got a full mark on PAT. He was so happy that he decided ...

  3. PAT甲级 1124. Raffle for Weibo Followers (20)

    1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...

  4. 1124 Raffle for Weibo Followers[简单]

    1124 Raffle for Weibo Followers(20 分) John got a full mark on PAT. He was so happy that he decided t ...

  5. pat 1124 Raffle for Weibo Followers(20 分)

    1124 Raffle for Weibo Followers(20 分) John got a full mark on PAT. He was so happy that he decided t ...

  6. PAT甲级:1124 Raffle for Weibo Followers (20分)

    PAT甲级:1124 Raffle for Weibo Followers (20分) 题干 John got a full mark on PAT. He was so happy that he ...

  7. PAT1124:Raffle for Weibo Followers

    1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...

  8. PAT_A1124#Raffle for Weibo Followers

    Source: PAT A1124 Raffle for Weibo Followers (20 分) Description: John got a full mark on PAT. He was ...

  9. 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 ...

随机推荐

  1. 通过application.properties配置SpringBoot项目

    application.properties可以自己新建,放在这里:(该文件可以放在4个地方,详情百度) 在文件中添加:file_path=E://Tools//apache-tomcat-9.0.1 ...

  2. numpy 矩阵归一化

    new_value = (value - min)/(max-min) def normalization(datingDatamat): max_arr = datingDatamat.max(ax ...

  3. servlet的补充

    1 request client获得请求. response 设置client响应2 text/html13123 不明确的响应用下载处理.3 MIME类型不明确在w3shool4 两种写utf-8的 ...

  4. spring3: helloword

    借助:eclipse,mavn,spring-tool-sitedchapter2.helloworld 项目搭建好了,让我们来开发接口,此处我们只需实现打印“Hello World!”,所以我们定义 ...

  5. lucas定理学习

    Lucas定理是用来求 c(n,m) mod p,p为素数的值. 表达式: C(n,m)%p=C(n/p,m/p)*C(n%p,m%p)%p 当我们遇到求一个N,M很大的组合数的时候,递推法就显得很耗 ...

  6. Linux下Python安装(脚本全)

    在linux下安装Python: # 下载最新版本 cd /usr/local/src/ sudo wget http://www.python.org/ftp/python/3.3.2/Python ...

  7. Nginx 常用配置模板

    user root root; worker_processes auto; worker_rlimit_nofile 51200; events { use epoll; worker_connec ...

  8. STM32F103: NRF24L01

    看了两天的24l01的相关资料了,一直有点模糊,今天下午感觉有点懂了,在板子上调试成功了,但是还没进行通讯测试.stm32和arduino进行通信还没成功 ,:( 先把stm32的NRF24L01配置 ...

  9. notepad++去空格空行技巧

    选择视图显示所有字符,替换成空的就行

  10. elasticsearch聚合案例--分组、求最大值再求最大值的均值

    一.需求 A.B.C代表3个用户,第二列代表各自的得分,求A.B.C的最好成绩以及A.B.C最好成绩的均值 A 10 A 11 A 13 B 11 B 11 B 12 C 10 C 10 C 11 C ...