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 ...
随机推荐
- MSSQL2005数据库显示单一用户模式,无法进行任何操作
MSSQL2005数据库显示单一用户模式,无法进行任何操作 经查询,使用exec sp_who进行查看链接线程,发现仍然有链接不断进行请求,将链接踢出,然后通过命令修复即可恢复 处理步骤: exec ...
- 使用mybatis如果类属性名和数据库中的属性名不一样取值就会为null
使用mybatis时如果类属性名和数据库中的属性名不一样取值就会为null 这是不能再去改变javabean中的属性,只能改变sql语句.语句如下所示: <select id="sel ...
- HTML5 ——web audio API 音乐可视化(一)
使用Web Audio API可以对音频进行分析和操作,最终实现一个音频可视化程序. 最终效果请戳这里; 完整版代码请戳这里,如果还看得过眼,请给一个start⭐ 一.API AudioContext ...
- mysql数据库优化课程---10、mysql数据库分组聚合
mysql数据库优化课程---10.mysql数据库分组聚合 一.总结 一句话总结:select concat(class,' 班') 班级,concat(count(*),' 人') 人数 from ...
- js中关于json常用的内容、js将数字保留两位小数
没什么好说的 保存起来 以后有个地方找 var json=eval("[]") //json定义 var s={"id":"xxx",& ...
- 【sparkSQL】DataFrame的常用操作
scala> import org.apache.spark.sql.SparkSession import org.apache.spark.sql.SparkSession scala> ...
- 【转】Symstore 详细使用
SymStore (symstore.exe) 是用于创建符号存储的工具.它被包含在Windows调试工具包中. SymStore按照某种格式存储符号,使得调试器可以通过时间戳.映像大小(对于.dbg ...
- Arcgis for Js之Graphiclayer扩展详解
在前两节,讲到了两种不同方式的聚类,一种是基于距离的,一种是基于区域范围的,两种不同的聚类都是通过扩展esri/layers/GraphicsLayer方法来实现的.在本节,就详细的讲讲esri/la ...
- 一次不成功的脚本Hack[捕鱼达人游戏]
捕鱼达人这款游戏[http://keleyi.com/game/1/] 想当然的以为在这个id为“fishContainer”的div上绑定一个点击事件,子弹就可以快速的发射. 为此用油猴挂载了一个j ...
- [leetcode]_Validate Binary Search Tree
题目:判断一棵二叉树是否合法.要求二叉树满足 左子树所有值 < 当前值 < 右子树所有值,并且所有点都满足这个条件. 思路: 1.从当前根节点判断,求根节点左子树最大值maxLeft,右子 ...