#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. Debian 7 安装 Emacs 24.4

    一. 安装依赖包 sudo apt-get build-dep emacs23 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 下列软件包将被[卸载]: li ...

  2. 自定义弧形的 tabBar

    // // TabBarViewController.h // LittleLoveLive // // Created by YJ // // TabBarViewController.m // L ...

  3. hadoop学习记录(二)HDFS java api

    FSDateinputStream 对象 FileSystem对象中的open()方法返回的是FSDateInputStream对象,改类继承了java.io.DateInoutStream接口.支持 ...

  4. 关于Windows常用命令

    本文引用自:http://ylbook.com/cms/computer/mingling.htm Windows Run命令: calc———–启动计算器certmgr.msc—-证书管理实用程序c ...

  5. Wince 中的图形编程

    图形编程程序当中,笔者主要要和大家讨论的是画刷的创建和使用以及绘图函数,比如2D图像的绘制等等. *画刷的定义: HBRUSH hBrush; *画刷的类型: 1. 系统内置画刷:GetStockOb ...

  6. poj 2724 二分图最大匹配

    题意: 会给出M个串,我们要做的就是将这M个串给清除了.对于任意两个串,若二进制形式只有一位不一样,那么这两个串可以在一次操作消除,否则每个操作只能消除一个串. 3 3 *01 100 011 可以代 ...

  7. Java -- Thread中start和run方法的区别

    一.认识Thread的 start() 和 run() 1.start(): 我们先来看看API中对于该方法的介绍: 使该线程开始执行:Java 虚拟机调用该线程的 run 方法. 结果是两个线程并发 ...

  8. HTML JSOgN to string

    JSON.stringify(json).replace(',', ', ').replace('[', '').replace(']', '')

  9. Android 第三方授权(微信篇)

    0.申请开发者: https://open.weixin.qq.com/cgi-bin/frame?t=home/app_tmpl&lang=zh_CN 1.下载sdk包: https://o ...

  10. CSS之颜色英文代码全集

    ColorHex在线颜色查询 <head> <title>CSS之颜色英文代码全集</title> <style type="text/css&qu ...