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

代码:

#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. Spark- 使用hiveContext时提交作业报错

    在spark上操作hive时不需要搭建hive环境,只需要从现有的hive集群中hive的conf目录下拷贝 hive-site.xml 到spark的conf目录下即可提交程序运行 出现报错 Cau ...

  2. angular ng-repeat 如何实现嵌套

    slides是一个二维数组 <div ng-repeat="links in slides"> <div ng-repeat="link in link ...

  3. 使用maven创建项目时报错The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path

    Description Resource Path Location Type The superclass "javax.servlet.http.HttpServlet" wa ...

  4. html笔记(1)

    hgroup 代替div figure figcaption 独立流内容 替代 dl mark 替代 span

  5. 【Demo】CSS3 3D转换

    3D转换transform rotateX() 方法 rotateX()方法,围绕其在一个给定度数X轴旋转的元素. div { transform: rotateX(120deg); -webkit- ...

  6. hdu1695莫比乌斯反演模板题

    hdu1695 求1<=i<=n&&1<=j<=m,gcd(i,j)=k的(i,j)的对数 最后的结果f(k)=Σ(1<=x<=n/k)mu[x]* ...

  7. 51nod 1640 MST+二分

    http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1640 1640 天气晴朗的魔法 题目来源: 原创 基准时间限制:1 秒 ...

  8. iOS调试技巧(debug)

        说到debug,可以说到的东西就太多了,一个程序员,即使逻辑非常出色,也会出现bug问题,那么debug是每个程序员必备的技巧,尤其是Xcode开发, 苹果公司的开发的Xcode真的是十分强大 ...

  9. MySQL index merge

    深入理解 index merge 是使用索引进行优化的重要基础之一. [ index merge]       当where谓词中存在多个条件(或者join)涉及到多个字段,它们之间进行 AND 或者 ...

  10. LRU与LFU比较

    提到缓存,有两点是必须要考虑的:(1)缓存数据和目标数据的一致性问题.(2)缓存的过期策略(机制).     其中,缓存的过期策略涉及淘汰算法.常用的淘汰算法有下面几种:(1)FIFO:First I ...