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 ...
随机推荐
- scala学习手记22 - 参数化类型的可变性
java 的代码中多少有些不是很严谨的内容,比如下面的这段代码: public class Trouble { public static void main(String[] args) { Int ...
- 使用SpringMVC时报错HTTP Status 405 - Request method 'GET' not supported
GET方法不支持.我出错的原因在于,在JSP中我希望超链接a以post方式提交,但是这里写js代码时出错. <script type="text/javascript"> ...
- 《JavaScript高级程序设计》第7章 函数表达式
定义函数的方式有两种:函数声明和函数表达式 // 函数声明 function function_name(argument) { // body... } // 函数表达式 var function_ ...
- Linux命令详解-cd
Linux cd 命令可以说是Linux中最基本的命令语句,其他的命令语句要进行操作,都是建立在使用 cd 命令上的. 所以,学习Linux 常用命令,首先就要学好 cd 命令的使用方法技巧. ...
- VS2015自带v120的Platform Toolset
在VS2015安装组件时,勾选 “Windows 8.1 和 Windows Phone 8.0/8.1”下面的“工具和 Windows SDK”,将会安装Visual Studio 2013 (v1 ...
- jQuery——操作复选框(checkbox) attr checked不起作用
这天用到jQuery功能,想实现一个简单的复选框动态全选或全不选,结果测试发现 attr(‘checked’,'checked’);与attr(‘checked’,true); 都不好使,要么第一次成 ...
- 通过IndexOf获得DataRow在DataTable中的行号
Row = dt.Rows.IndexOf(dr);
- Week2《Java程序设计》第二周学习总结
Week02-Java学习笔记2 1. 本周学习总结 本周学习了java的基本语法与类库,其中介绍了基本数据类型和引用类型,介绍了String类,String对象的拼接以及String的一些常用方法: ...
- .net学习路线(转)
入门篇1. 学习面向对象(OOP)的编程思想 许多高级语言都是面向对象的编程,.NET也不例外.如果您第一次接触面向对象的编程,就必须理解类.对象.字段.属性.方法和事件.封装.继承和 ...
- python学习之aop装饰模式
实际开发过程当中可能要对某些方法或者流程做出改进,添加监控,添加日志记录等所以我们要去改动已有的代码,自己的或者别人的,但改动后测试不周会引发不可控的异常,aop 模式解决了这类问题引发重复代码大量积 ...