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 ...
随机推荐
- 通过application.properties配置SpringBoot项目
application.properties可以自己新建,放在这里:(该文件可以放在4个地方,详情百度) 在文件中添加:file_path=E://Tools//apache-tomcat-9.0.1 ...
- numpy 矩阵归一化
new_value = (value - min)/(max-min) def normalization(datingDatamat): max_arr = datingDatamat.max(ax ...
- servlet的补充
1 request client获得请求. response 设置client响应2 text/html13123 不明确的响应用下载处理.3 MIME类型不明确在w3shool4 两种写utf-8的 ...
- spring3: helloword
借助:eclipse,mavn,spring-tool-sitedchapter2.helloworld 项目搭建好了,让我们来开发接口,此处我们只需实现打印“Hello World!”,所以我们定义 ...
- lucas定理学习
Lucas定理是用来求 c(n,m) mod p,p为素数的值. 表达式: C(n,m)%p=C(n/p,m/p)*C(n%p,m%p)%p 当我们遇到求一个N,M很大的组合数的时候,递推法就显得很耗 ...
- Linux下Python安装(脚本全)
在linux下安装Python: # 下载最新版本 cd /usr/local/src/ sudo wget http://www.python.org/ftp/python/3.3.2/Python ...
- Nginx 常用配置模板
user root root; worker_processes auto; worker_rlimit_nofile 51200; events { use epoll; worker_connec ...
- STM32F103: NRF24L01
看了两天的24l01的相关资料了,一直有点模糊,今天下午感觉有点懂了,在板子上调试成功了,但是还没进行通讯测试.stm32和arduino进行通信还没成功 ,:( 先把stm32的NRF24L01配置 ...
- notepad++去空格空行技巧
选择视图显示所有字符,替换成空的就行
- elasticsearch聚合案例--分组、求最大值再求最大值的均值
一.需求 A.B.C代表3个用户,第二列代表各自的得分,求A.B.C的最好成绩以及A.B.C最好成绩的均值 A 10 A 11 A 13 B 11 B 11 B 12 C 10 C 10 C 11 C ...