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 < ...
随机推荐
- Git提交分支
Git提交分支操作 1.git add 命令告诉 Git 开始对这些文件进行跟踪 git add . 2.然后提交 git commit -m'这是注释信息' 3.git pull命令用于从另一个存储 ...
- Nginx防hashdos模块使用帮助
经过上周一周朋友们帮忙测试和bug fix,nginx_http_hashdos_module已经达到可以线上使用的水平,下面是使用记录. 下载 #wget --no-check-certificat ...
- MyBatis insert操作插入,返回主键from官方
下面就是 insert,update 和 delete 语句的示例: <insert id="insertAuthor" parameterType="domain ...
- FastDFS分布文件系统Java客户端使用
原文链接:http://blog.csdn.net/xyang81/article/details/52847311 Java客户端源代码和jar:链接:http://pan.baidu.com/s/ ...
- 1.HBase In Action 第一章-HBase简介(后续翻译中)
This chapter covers ■ The origins of Hadoop, HBase, and NoSQL ■ Common use cases for HBase ■ A basic ...
- 【Odoo 8开发教程】第一章:Odoo 8.0安装
转载请注明原文地址:https://www.cnblogs.com/cnodoo/p/10779733.html odoo有三种常见的安装方式:打包程序安装.源码安装以及Docker镜像安装. 一:打 ...
- day1-课堂笔记
venv 执行方法: 1,pycharm执行 2,cmd命令窗口执行:python D:\PyCharmProjects\MyProject\day1.py 回车 java原理: HW.jav ...
- java.util.zip.ZipException: duplicate entry(重复依赖多版本的类库)
同步SVN仓库中的代码,更新后,运行项目,出现如下错误: com.android.build.api.transform.TransformException: java.util.zip.ZipEx ...
- pycham database查看db.sqlites文件 无内容解决方法
初学django,使用pycharm IDE的时候,通过使用默认的sqlites数据库,执行问makemigration 和migrate操作之后,控制台正常输出类似如下结果,按照道理应该生成了数据表 ...
- Jmeter上传下载文件
每次使用时都会忘记,此处是存储网路上通用的方式. 1.上传文件 记得勾选“use multipart/form-data for post”,表明此请求包含文件信息.在信息请求头中,需加入“Con ...