#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std; struct stu
{
char ID[];
int GetTime[];
int LeaveTime[];
}; stu Student[]; int main()
{
int n,i,j;
int m;
while(scanf("%d",&m)!=EOF)
{ for(j=;j<m;j++)
{
scanf("%s %d:%d:%d %d:%d:%d",Student[j].ID,&Student[j].GetTime[],&Student[j].GetTime[],&Student[j].GetTime[],&Student[j].LeaveTime[],&Student[j].LeaveTime[],&Student[j].LeaveTime[]);
} int GetHour,GetMin,GetSec,LeaveHour,LeaveMin,LeaveSec; GetHour=GetMin=GetSec=;
LeaveHour=LeaveHour=LeaveSec=-; int OpenMan,CloseMan; for(j=;j<m;j++)
{
if(Student[j].GetTime[]<GetHour)
{
GetHour=Student[j].GetTime[];
OpenMan=j;
}
else if(Student[j].GetTime[]==GetHour)
{
if(Student[j].GetTime[]<GetMin)
{
GetMin=Student[j].GetTime[];
OpenMan=j;
}
else if(Student[j].GetTime[]==GetMin)
{
if(Student[j].GetTime[]<GetSec)
{
GetSec=Student[j].GetTime[];
OpenMan=j;
}
}
} if(Student[j].LeaveTime[]>LeaveHour)
{
LeaveHour=Student[j].LeaveTime[];
CloseMan=j;
}
else if(Student[j].LeaveTime[]==LeaveHour)
{
if(Student[j].LeaveTime[]>LeaveMin)
{
LeaveMin=Student[j].LeaveTime[];
CloseMan=j;
}
else if(Student[j].LeaveTime[]==LeaveMin)
{
if(Student[j].LeaveTime[]>LeaveSec)
{
LeaveSec=Student[j].LeaveTime[];
CloseMan=j;
}
}
}
} printf("%s %s\n",Student[OpenMan].ID,Student[CloseMan].ID); }
return ;
}

1006. Sign In and Sign Out的更多相关文章

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

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

  9. PAT1006:Sign In and Sign Out

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

  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. struts2.1笔记02:servlet简介

    1.     Servlet 是在服务器上运行的小程序.这个词是在 Java applet的环境中创造的,Java applet 是一种当作单独文件跟网页一起发送的小程序,它通常用于在客户端运行,结果 ...

  2. Curl上传文件

    curl -v -XPOST -H /thumbnail

  3. Jsonp post 跨域方案

    近期在项目中遇到这样一问题,关于jsonp跨域问题,get传值是可以的,但post传值死活不行啊,于是网上看了一大堆关于这方面的资料,最终问题得以解决,今天抽空与大家分享下. 说明:http://ww ...

  4. 类、对象以及jvm运行内存解析

    一.JVM内存的分析: 第一步:存放在硬盘上的程序首先要被加载到内存空间中. 第二步:内存中的jvm找到程序中main函数作为入口,然后开始执行. 第三步:执行过程中的内存管理:内存分为四个部分: 栈 ...

  5. [转]Response.AddHeader 文本下载

    本文转自:http://hi.baidu.com/yuxi981/item/7c617fc41b03ad60f6c95d30 Response.AddHeader实现下载     /// <su ...

  6. hdu 2004 成绩转换

    成绩转换 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submi ...

  7. Oracle的GUID:Raw(16)

    最近用了Oracle作为开发的数据库.以前用Sqlserver的时候用GUID作为主键的(数据类型:uniqueidentifier),Oracle的GUID类型变成RAW(16)了.从数据库读出来R ...

  8. asp网站发布步骤总结

    1.在VS2012中打开索要发布的网站,初始页可重命名为index.html或default.apx. 2.点击  生成>生成“网站”,然后“发布网站”. 3.进行发布设置: (1 配置文件 ( ...

  9. ### OpenCV安装(Linux)

    ### OpenCV安装(Linux) @(gr_self)[ffmpeg | openCV] #@author: gr #@date: 2015-09-02 #@email: forgerui@gm ...

  10. PHP学习笔记 - 进阶篇(6)

    PHP学习笔记- 进阶篇(6) 会话控制(session与cookie) 当前的Cookie为: cookie简介 Cookie是存储在客户端浏览器中的数据,我们通过Cookie来跟踪与存储用户数据. ...