#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
struct visitor{
char ID[20];
int in_h,in_m,in_s;
int out_h,out_m,out_s;
}v[N]; int main(){
int m,i;
struct visitor late,early;//最晚,最早
scanf("%d",&m);
for( i = 0;i < m; i++)
{
scanf("%s %d:%d:%d %d:%d:%d",v[i].ID,&v[i].in_h,&v[i].in_m,&v[i].in_s,&v[i].out_h,&v[i].out_m,&v[i].out_s); }
late = v[0];
early = v[0];
for(i = 1;i < m; i++)
{
if(v[i].in_h < early.in_h) {
early = v[i];
}
else if(v[i].in_h == early.in_h) {
if(v[i].in_m < early.in_m){
early = v[i];
}
else if(v[i].in_m == early.in_m){
if(v[i].in_s < early.in_s ){
early = v[i];
}
}
}
if(v[i].out_h > late.out_h) {late = v[i];}
else if(v[i].out_h == late.out_h){
if(v[i].out_m > late.out_m){
late = v[i];
}
else if(v[i].out_m == late.out_m){
if(v[i].out_s > late.out_s)
{
late = v[i];
}
}
}
}
printf("%s %s",early.ID,late.ID);
return 0;
}

  

PATA 1006. Sign In and Sign Out (25)的更多相关文章

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

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

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

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

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

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

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

  9. PAT甲级——1006 Sign In and Sign Out

    PATA1006 Sign In and Sign Out At the beginning of every day, the first person who signs in the compu ...

  10. PAT1006:Sign In and Sign Out

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

随机推荐

  1. ValueStack和OGNL达到Struts2形式的数据存储原理

    (1)最近学习struts相框,我们在快乐struts强大.为了便于使用转发,但不了解详细的内部数据存储: (2)网上找了很多关于struts数据存储的原理,但我还没有找到一个具体的解释,本书上找到了 ...

  2. Codeforces Round #160 (Div. 2)---A. Roma and Lucky Numbers

    Roma and Lucky Numbers time limit per test 1 second memory limit per test 256 megabytes input standa ...

  3. wpf listbox 选中项 上移下移

    原文:wpf listbox 选中项 上移下移 private void MoveUp_Click(object sender, RoutedEventArgs e)         {        ...

  4. css3 hover平滑过渡效果,鼠标经过元素,背景渐隐渐现效果

    下面实例,演示,鼠标经过时,改变div宽度,平滑改变,带动画 div { width:100px; height:100px; background:blue; transition:width 2s ...

  5. 全面剖析Redis Cluster原理和应用 (good)

    redis redis cluster注意的问题 : 1.‘cluster-require-full-coverage’参数的设置.该参数是redis配置文件中cluster模式的一个参数,从字面上基 ...

  6. UWP显示对话框

    public static async void ShowMessage(string message) { var msgDialog = new Windows.UI.Popups.Message ...

  7. ML:多变量线性回归(Linear Regression with Multiple Variables)

    引入额外标记 xj(i) 第i个训练样本的第j个特征 x(i) 第i个训练样本对应的列向量(column vector) m 训练样本的数量 n 样本特征的数量 假设函数(hypothesis fun ...

  8. Oracle emca on linux

    http://blog.csdn.net/haibusuanyun/article/details/16338591 bash-3.2$  lsnrctl status LSNRCTL for Lin ...

  9. Windows下libevent C++封装类实现

    题记 windows平台下对于服务器高并发的网络模型选型中,使用libevent是个不错的选择. 本文的背景基于:国内博客对于libevent大多介绍linux实现,大多是c语言的实现,Windows ...

  10. RESTful API设计原则与规范

    RESTful API设计原则与规范 一.背景与基础概念 2 二.RESTful API应遵循的原则 3 1.协议(Protocol) 3 2.域名(ROOT URL) 3 3.版本(Versioni ...