A1006. Sign In and Sign Out(25)
25/25,一遍过了,很开心。
#include<bits/stdc++.h>
using namespace std;
struct record{
string id;
string in_time;
string out_time;
};
vector<record> records;
void solve(){
int m;
cin>>m;
int t=0;
int unlockman=0;
int lockman=0;
string earliest_in,latest_out;
earliest_in="23:59:59";
latest_out="00:00:00";
while(m--){
record r;
cin>>r.id>>r.in_time>>r.out_time;
records.push_back(r);
if(r.in_time<earliest_in){unlockman=t;earliest_in=r.in_time;}
if(r.out_time>latest_out){lockman=t;latest_out=r.out_time;}
t++;
}
cout<<records[unlockman].id<<" "<<records[lockman].id;
}
int main(){
solve();
return 0;
}
这样的题多做其实也无益,所以为了节省时间,不妨只做通过率在0.35以下的题。挑战稍微有点难度的题。
A1006. Sign In and Sign Out(25)的更多相关文章
- 1006 Sign In and Sign Out (25 分)
1006 Sign In and Sign Out (25 分) At the beginning of every day, the first person who signs in the co ...
- PAT 甲级 1006 Sign In and Sign Out (25)(25 分)
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- PAT甲 1006. Sign In and Sign Out (25) 2016-09-09 22:55 43人阅读 评论(0) 收藏
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- 1006 Sign In and Sign Out (25)(25 分)思路:普通的时间比较题。。。
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
- pat1006. Sign In and Sign Out (25)
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- pat 1006 Sign In and Sign Out(25 分)
1006 Sign In and Sign Out(25 分) At the beginning of every day, the first person who signs in the com ...
- PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642
PAT (Advanced Level) Practice 1006 Sign In and Sign Out (25 分) 凌宸1642 题目描述: At the beginning of ever ...
- PAT1006:Sign In and Sign Out
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
- PTA (Advanced Level) 1006 Sign In and Sign Out
Sign In and Sign Out At the beginning of every day, the first person who signs in the computer room ...
- PAT Sign In and Sign Out[非常简单]
1006 Sign In and Sign Out (25)(25 分) At the beginning of every day, the first person who signs in th ...
随机推荐
- Linux学习之路-2017/12/22
第三章 管道符.重定向与环境变量 管道命令符,“|”,作用是将前一个命令的标准输出当作后一个命令的标准输入, 格式:“命令A|命令B” 输入输出重定向, 标准输入,STDIN,文件描述符为0,默认从 ...
- sysbench压力工具报错:
[root@ sysbench-]# /usr/local/sysbench/bin/sysbench --version : cannot open shared object file: No s ...
- xml的xsi:type序列化和反序列化
最近在做HL7V3的对接,关于XML的序列化和反序列化遇到xsi:type的问题解决方法 实体类定义: public class HL7V3_ProviderOrganization { public ...
- SDN第五次上机作业--基于组表的简单负载均衡
0.作业链接 http://www.cnblogs.com/easteast/p/8125383.html 1.实验目的 1.搭建如下拓扑并连接控制器 2.下发相关流表和组表实现负载均衡 3.抓包分析 ...
- [提权]域内提权神器 MS14-068 完整EXP
可以让任何域内用户提升为域管理员 c:\python27\python.exe ms14-068.py -u k8test3@k8.local -p k8team!@# -s S-1-5-2 ...
- JSONP跨域和CORS跨域
什么是跨域? 跨域:指的是浏览器不能执行其它网站的脚本,它是由浏览器的同源策略造成的,是浏览器的安全限制! 同源策略 同源策略:域名.协议.端口均相同. 浏览器执行JavaScript脚本时,会检查这 ...
- word怎样从第三页开始设置页码
一般的文件都是有封面,目录.然后才是正文.所以基本上第一页的封面,第二页是目录,第三页才是正文的开始.但是默认的页码会从第一页开始的,封面上海有页码这会很难看,今天和小编一起来看看怎样将页码从第三页开 ...
- 天地图api地址
天地图地址 http://lbs.tianditu.com/api-new/examples.html 参考资料 http://lbs.tianditu.com/api-new/class.html
- 智能家居 (2)手机一键自配置APP
说明 本教程主要记录APP端一键自配置功能+TCP/IP通信 0配套使用单片机烧录 /* 文件名称:smartconfig.ino 功能:ESP8266快速配置功能 作者:www.doit.am 日期 ...
- .netcore部署Linux并结合Nginx反向代理 get started
一..NetCore网站准备与发布 首先准备好一个ASP.NET Core Web应用程序,我这里就使用新建的示例站点作为demo演示,使用dotnet publish 命令发布网站. 或者使用VS的 ...