1124 Raffle for Weibo Followers
题意:水题,直接贴代码了。(为什么我第一遍做的时候代码写的那么烦?)
代码:
#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的更多相关文章
- 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 ...
- 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 ...
- PAT甲级 1124. Raffle for Weibo Followers (20)
1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...
- 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 ...
- 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 ...
- 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 ...
- PAT1124:Raffle for Weibo Followers
1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...
- PAT_A1124#Raffle for Weibo Followers
Source: PAT A1124 Raffle for Weibo Followers (20 分) Description: John got a full mark on PAT. He was ...
- 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 ...
随机推荐
- JNIjw06
1.VC6(CPP)的DLL代码: #include<stdio.h> #include "jniZ_JNIjw06.h" // 全局变量 jfieldID g_pro ...
- 解读Mirantis最新的Neutron性能测试
最近,mirantis的工程师发布了最新的基于Mitaka版本的Neutron性能测试结果.得出的结论是:Neutron现在的性能已经可以用生产环境了. 报告的三位作者都是OpenStack社区的活跃 ...
- Java 基于JavaMail的邮件发送
http://blog.csdn.net/xietansheng/article/details/51673073 http://blog.csdn.net/xietansheng/article/d ...
- Sunday算法--C#版
public static int Sunday(string text, string pattern) { int i, j, m, k; i = j = 0; int tl, pl; int p ...
- STM32F103: NRF24L01
看了两天的24l01的相关资料了,一直有点模糊,今天下午感觉有点懂了,在板子上调试成功了,但是还没进行通讯测试.stm32和arduino进行通信还没成功 ,:( 先把stm32的NRF24L01配置 ...
- 【C#】Socket中的ssl通信
引言 有个项目中用到了Socket ssl通信,在此记录一下. 证书 Socket ssl需要用到证书用来校验身份,而作为调试,我们只需用测试证书即可. 有个工具可以很方便地制作测试证书,下载地 ...
- 2017.10.30 Epicor -ERP
1 公司新用ERP系统,做使用培训,mark... This course reviews the project management flow in the Epicor application. ...
- 【linux】ulimit限制打开的文件数量
以限制打开文件数为例. ulimit -Hn 查看硬限制. ulimit -Sn 查看软限制. ulimit -n 查看两个中更小的限制(软限制始终比硬限制低, 所以查看的是软限制) 设定规则 1.软 ...
- 安装nodejs+npm的体验
NODEJS.NPM安装配置步骤(WINDOWS版本) 1.windows下的NodeJS安装是比较方便的(v0.6.0版本之后,支持windows native),只需要登陆官网(http://no ...
- Dojo Chart之常用统计图
很多做web的都知道,在很多web系统中会涉及到一些统计图,例如饼状图,柱状图.趋势图.以及叠加图等.提到这儿,做web的都很熟悉的,jquery的highcharts就能搞定所有的涉及到统计图的功能 ...