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

代码:

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <fstream>
using namespace std;

int main()
{
    //ifstream cin("pat.txt");
    int forwardCnt,step,start;
    cin>>forwardCnt>>step>>start;
    string name;
    vector<string> vec(forwardCnt),win;
    map<string,int> mp;//标记已获奖的人
    int skip=step;
    ;i<forwardCnt;i++)
        cin>>vec[i];
    if(start>vec.size()) cout<<"Keep going...";
    else{
        ;//从第一个中奖者开始
        while(i<vec.size()){
            string query=vec[i];
            ){//该用户在此前还没有获过奖
                win.push_back(query);
                mp[query]=;
                i+=step;
            }else{
                i++;
            }
        }
        for(auto it:win)//可以用C++11,方便
            cout<<it<<'\n';
    }
    ;
}

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. 开发常用js代码段

    // 获取http传递的参数export const getRequest = ()=>{ var url = location.search; //获取url中"?"符后的 ...

  2. Django进阶Model篇004 - ORM常用操作

    一.增加 create和save方法 实例: 1.增加一条作者记录 >>> from hello.models import * >>> Author.object ...

  3. poj2723 2-sat

    当两个门锁相同时,这个钥匙必须用,不同时分开用 可以直接遍历门,当然二分更快 #include<map> #include<set> #include<cmath> ...

  4. eclipse启动Tomcat服务输入http://localhost:8080/报404解决方法

    其实如果Tomcat能够正常启动,而就算输入http://localhost:8080时出现404错误,也不会影响Tomcat作为服务器运行.通过eclipse来启动tomcat会碰到“访问http: ...

  5. Ubuntu的root用户问题

    在Ubuntu中系统是默认禁止root用户登入操作,要使用超级用户可以加sudo 例: sudo chown book:book /work -R 或者切换到root su  root passwor ...

  6. ZOJ 3204 Connect them(最小生成树+最小字典序)

    Connect them Time Limit: 1 Second      Memory Limit: 32768 KB You have n computers numbered from 1 t ...

  7. New Concept English three (37)

    28 words/minute 44 typing errors We have learnt to expect that trains will be punctual. After years ...

  8. 简要谈谈javascript bind 方法

    最近去参加了场面试,跟面试官聊了很多JS基础上的东西,其中有个问题是谈谈对apply.call.bind的理解和区别.顿时一愣,apply.call我知道,经常用的东西,bind是什么鬼!!!好像见过 ...

  9. Mysql中文汉字转拼音的实现(每个汉字转换全拼)

    -- 创建汉字拼音对照临时表 CREATE TABLE IF NOT EXISTS `t_base_pinyin` ( `pin_yin_` varchar(255) CHARACTER SET gb ...

  10. TCP服务器端口数,最大连接数以及MaxUserPort的关系辨真

    原文连接:http://www.jianshu.com/p/4a58761d758f 关于TCP服务器最大并发连接数有一种误解就是"因为端口号上限为65535,所以TCP服务器理论上的可承载 ...