PAT甲题题解-1124. Raffle for Weibo Followers-模拟,水题
水题一个,贴个代码吧。
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
#include <string>
#include <map> using namespace std;
const int maxn=;
map<string,int> maps;
int main()
{
int n,m,s;
string str;
scanf("%d %d %d",&m,&n,&s);
int cnt=;
if(m<s){
printf("Keep going...\n");
}
else{
for(int i=;i<s;i++)
cin>>str;
maps[str]=;
cout<<str<<endl;
for(int i=s;i<m;i++){
cin>>str;
cnt++;
if(cnt==n){
if(!maps[str]){
maps[str]=;
cnt=;
cout<<str<<endl;
}
else
cnt--;
}
} } return ;
}
PAT甲题题解-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 ...
- PAT甲级 1124. Raffle for Weibo Followers (20)
1124. Raffle for Weibo Followers (20) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN ...
- 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 ...
- 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 ...
- 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甲题题解-1012. The Best Rank (25)-排序水题
排序,水题因为最后如果一个学生最好的排名有一样的,输出的课程有个优先级A>C>M>E那么按这个优先级顺序进行排序每次排序前先求当前课程的排名然后再与目前最好的排名比较.更新 至于查询 ...
- PAT甲题题解-1019. General Palindromic Number (20)-又是水题一枚
n转化为b进制的格式,问你该格式是否为回文数字(即正着写和倒着写一样)输出Yes或者No并且输出该格式又是水题... #include <iostream> #include <cs ...
- PAT甲题题解-1062. Talent and Virtue (25)-排序水题
水题,分组排序即可. #include <iostream> #include <cstdio> #include <algorithm> #include < ...
随机推荐
- 每年有20万人进军IT行业,为何还会人才短缺?
众所周知,IT行业是个高薪行业,也是很多人的梦想职业,在全球最缺人的十大行业中IT行业居首位. 但是现在很多人都有一个疑问: 几乎每所大学里都有计算机技术相关专业,再加上IT培训机构的输出,每年培养出 ...
- 笔记本键盘开关方法 仅限window系统
按win键,搜索CMD(命令提示符).右键-以管理员身份运行.关闭笔记本键盘输入:sc config i8042prt start= disabled回车-重启电脑即可.需要重新启用键盘的话,输入:s ...
- css常见效果
1.ul li横排 /* ul li以横排显示 */ /* 所有class为menu的div中的ul样式 */ div.menu ul { list-style:none; /* 去掉ul前面的符号 ...
- Nginx反向代理及简单负载均衡配置
nginx配置文件主要分为六个区域:main section.events section.http section.sever section.location section.upstream s ...
- VS2015+OpenGL4.0开发编译时弹出错误:glaux.lib(tk.obj) : error LNK2019: 无法解析的外部符号 _sscanf,该符号在函数 _GetRegistrySysColors@8 中被引用
一.问题描述: VS2015+OpenGL4.0开发编译时弹出如下所示的错误: 1>glaux.lib(tk.obj) : error LNK2019: 无法解析的外部符号 _sscanf,该符 ...
- javascript仿新浪微博图片放大缩小及旋转效果
javascript仿新浪微博图片放大缩小及旋转效果 经常看到新浪微博里有图片放大缩小旋转效果,感觉效果还不错,所以就想试着做一个类似的demo出来,至于旋转对于IE可以用滤镜来解决,标准的浏览器可以 ...
- DC-DC Controllers Use Average-Current-Mode Control for Infotainment Applications-3939
DC-DC Controllers Use Average-Current-Mode Control for Infotainment Applications Abstract: Auto info ...
- android学习---Gallery画廊视图
Gallery与Spinner有共同父类:AbsPinner.说明Gallery与Spinner都是一个列表框. 它们之间的差别在于Spinner显示的是一个垂直的列表选择框,而Gallery显示的是 ...
- centos7 sentry部署指南
依赖说明 sentry官方推荐docker方式安装,使用到了docker-compose.docker至少是1.10.3以上的版本.为此需要使用centos7. 安装docker #添加yum 源 # ...
- excel的宏与VBA入门(三)——流程控制
一.条件控制IF if 逻辑表达式 then 语句块 end if 带else的if语句: If 逻辑表达式1 Then 语句块1 ElseIf 逻辑表达式2 Then 语句块2 ElseIf 逻辑表 ...