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 ...
随机推荐
- mongodb笔记(一) 分片 &&文档连接
版本:mongodb3.4 ; 分片: 工作顺序:router=>config=>shards 一,配置config: 3.4中config必须为replSet.下面配置两个config. ...
- javascript HTML DOM 简单介绍
JavaScript HTML DOM通过 HTML DOM,可访问 JavaScript HTML 文档的所有元素.HTML DOM (文档对象模型)当网页被加载时,浏览器会创建页面的文档对象模型( ...
- Android ADT远程主机强迫关闭了一个现有的连接 Connection attempts: 1 解决方法
adb有一个限制, 也可以说是bug. 当手机上同时运行的进程数大于64时, 就会引发adb奔溃. 更深层次的原因, 就是windows API的WaitForMultipleObjects所支持的 ...
- mysql 自查询
先介绍用法: 用法解释 select * from a,b : shopping 商品表 , baixitest SELECT b.name from shopping as a, baixi ...
- 29-THREE.JS 根据公式画形状
<!DOCTYPE html> <html> <head> <title></title> <script src="htt ...
- SVN 用户名切换
方法1:主要针对Window下安装了客户端设置 右键桌面-->settings-->Saved Data -->Authentication data -->clear 方法2 ...
- Python 把二进制mnist数据库转换为图片
mnist数据库可以通过caffe里的get_mnist.sh文件下载,路径是: caffe-master/data/mnist/get_mnist.sh,get_mnist.sh内容如下: #!/u ...
- GIL、死锁与递归锁
一.互斥锁 用互斥锁,目的:局部串行(保护自己的数据 进程之间数据不共享,但是共享同一套文件系统,所以访问同一个文件,或同一个打印终端,是没有问题的,竞争带来的结果就是错乱,如何控制,就是加锁处理(即 ...
- 【MFC】MFC改变对话框中静态文本的字体大小
MFC改变对话框中静态文本的字体大小 2010/08/09 11:30 VC的对话框字体设置对所有控件都有效,你不能单独地改变某个静态文本的字体.对于你的问题,需要首先用CreateFont来建立一个 ...
- WPF XMAL获取元素的父元素,子元素
/// 获得指定元素的父元素 /// </summary> /// <typeparam name="T">指定页面元素</typeparam> ...