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)的更多相关文章

  1. 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 ...

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. pat1006. Sign In and Sign Out (25)

    1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...

  6. 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 ...

  7. 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 ...

  8. PAT1006:Sign In and Sign Out

    1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...

  9. 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 ...

  10. 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 ...

随机推荐

  1. Win7 user profile cant logon

    1.local user:testlb1 1234@cat can login safe model 1.重新启动计算机开机时连续点击F8,选择进入安全模式.2.开始-在搜索栏中输入services. ...

  2. 解决windows下vim中文乱码

    解决windows下vim中文乱码 windows安装了vim8,也就是gvim后,打开带有中文的文档,显示中文是乱码. 毕竟有许多文档我是用utf-8编码的,所以解决的办法是设置一下编码为utf-8 ...

  3. elasticsearch之JAVA环境变量报错:could not find java; set JAVA_HOME or ensure java is in PATH

    在以RPM包安装elasticsearch过程中出现报错JAVA环境的问题: ● elasticsearch.service - Elasticsearch Loaded: loaded (/usr/ ...

  4. phpstorm 的.idea 目录加入.gitignore无效的解决方法

    无效的原因是:对应的目录或者文件已经被git跟踪,此时再加入.gitignore后就无效了, 解决办法: 先执行 git rm -r --cached .idea 再重新加入.gitignore文件 ...

  5. ffmpeg常用参数一览表

    基本选项: -formats 输出所有可用格式 -f fmt 指定格式(音频或视频格式) -i filename 指定输入文件名,在linux下当然也能指定:0.0(屏幕录制)或摄像头 -y 覆盖已有 ...

  6. 转 10 个 Nginx 的安全提示

    Nginx是当今最流行的Web服务器之一.它为世界上7%的web流量提供服务而且正在以惊人的速度增长.它是个让人惊奇的服务器,我愿意部署它. 下面是一个常见安全陷阱和解决方案的列表,它可以辅助来确保你 ...

  7. jQuery UI dialog插件出错信息:$(this).dialog is not a function

    使用jQuery UI 1.7.2 dialog插件,遇到这样的错误: [img]http://dl.iteye.com/upload/attachment/308166/97c428e4-2ce2- ...

  8. NOI 2018网络同步赛(游记?)

    刚中考完那段时间比较无聊,报名了一个同步赛,报完名才发现成绩单是要挂到网上的,而且因为报的早给了一个很靠前的考号...那布星啊,赶紧学点东西,于是在一周内学了网络流,Treap以及一些数论. Day1 ...

  9. Tarjan-割点&桥&双连通

    $Tarjan$求割点 感觉图论是个好神奇的东西啊,有各种奇奇怪怪的算法,而且非常巧妙. 周末之前说好回来之后进行一下学术交流,于是wzx就教了$Tarjan$,在这里我一定要说: wzx  AK   ...

  10. PHP缓存锁原理及利用

    原文链接:https://blog.csdn.net/tim_phper/article/details/54949404 概述: 项目当中经常要考虑数据高并发的情况,为了避免并发导致出现一些资源重复 ...