PATA 1006. Sign In and Sign Out (25)
#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)的更多相关文章
- 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 ...
- 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) 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 ...
- 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 (25)
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甲级——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 ...
- PAT1006:Sign In and Sign Out
1006. Sign In and Sign Out (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue ...
随机推荐
- wpf之自定义滚动条
原文:wpf之自定义滚动条 首先我们添加一个带滚动条的textbox控件: <ScrollViewer Height="130" Width="620" ...
- 使用WinPcap获取网卡MAC地址
关键字:WinPcap 网卡 MAC地址 作者:txw1958 在WpdPack_4_1_2\WpdPack\Examples-remote\PacketDriver\GetMacAddress\目录 ...
- 如何导入以前的qq聊天记录
作者:朱金灿 来源:http://blog.csdn.net/clever101 在新版的qq2013已经可以设置聊天记录的保存路径,但是如何把以前的聊天记录都导入进来呢?今天找到了办法.首先把原来q ...
- 一台虚拟机配置nginx反向代理+3个apache虚拟主机
三个虚拟主机通过一张网卡添加三个IP来实现 一.安装nginx 1.解决依赖 [root@xuegod1 ~]# yum groupinstall "Development Tools&qu ...
- 解压压缩文件报错gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
压缩包是直接weget 后面加官网上的tar包地址获取的 [root@xuegod43 ~]# tar -zxvf /home/hadoop/hadoop-2.6.5-src.tar.gz gzip ...
- 线程操纵UI问题
WPF只允许UI线程修改UI,其他线程必须通过Invoke.委托(安全性)Winform可以开启/关闭“只允许UI线程修改UI” 在WPF中非UI线程修改UI的方法 非UI线程直接修改UI,会报错 S ...
- socket函数集-----网络编程必备值得拥有
accept(接受socket连线) 相关函数 socket,bind,listen,connect 表头文件 #include<sys/types.h> #include<sys/ ...
- Web service的学习资源
看了半天的Web service,总算是对它有了一点眉目,不枉此行:)那就整理一下吧,来日还需要用到呢! 1.什么是Web service(请看这儿). 2.Web service的开发 ...
- 让您的应用兼容 Android Oreo
不知不觉Android Oreo已经发布几个月时间了,你的应用开始使用最新平台了吗?在应用迁移过程中是否遇到了一些棘手问题?你的Android应用兼容Oreo如何呢? 我们应该都知道,每一次重大升级, ...
- Qt实现长文件名(字符串)在QLabel中自适应缩短
一.应用场景简述 当在有限宽度的QLable中显示很长的文件名/字符串时,超出QLabel宽度部分将不会显示,此时采取缩短文件名策略(也可实现为字符串滚动动画)可以缓解这一问题.在实现这一想法的过程中 ...