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 ...
随机推荐
- [C#]Windows系统特殊文件夹路径获取
原文:[C#]Windows系统特殊文件夹路径获取 由于软件开发的需要,近期对Windows特殊文件夹(如桌面,我的文档等)路径的查找方法进行了研究,结果如下. 获取特殊文件夹的方法不止一种,下面列出 ...
- 深入python3 (Dive Into Python 3) 在线阅读与下载
在线阅读:http://book.doucube.com/diveintopython3/ 中文版 下载地址:https://github.com/downloads/diveintomark/di ...
- 零元学Expression Design 4 - Chapter 6 教你如何在5分钟内做出文字立体感效果
原文:零元学Expression Design 4 - Chapter 6 教你如何在5分钟内做出文字立体感效果 又来一篇五分钟做设计啦~ 本篇将教大家如何运用Design内建工具Blend Path ...
- python_matplotlib cannot import name _thread on mac
最后的2行错误信息是 from six.moves import _thread ImportError: cannot import name _thread 1 2 发现是six出现了问题,用pi ...
- Entity相互关系
查看 1.图表(.edmx) Model First可以2.代码 内部包含对方(回溯) 1:1 1 2 1:N 3 4 N:M 5 6
- 1 min 数据查询 SQL 优化
问题 前几天线上数据库 IOPS 飙升,一直居高不下,最近并没有升级.遂查看数据库正在执行的 SQL 语句,发现有个查询离线设备的语句极其缓慢. 探寻原因 SELECT o.* FROM ( SELE ...
- jquery 包裹标签
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content=&q ...
- C# System.Timers.Timer的使用
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threa ...
- wcf服务端代码方式及客户端代码方式
ServiceHost host; // 全局 host = new ServiceHost(typeof(实现服务接口的类)); host.open(); 用代码配置端点的方法 host.add ...
- uwp开发————换背景图片
原文:uwp开发----换背景图片 用后台代码来实现对容器背景的切换,用本地图片作为背景. 把需要的图片素材放到Assets文件夹下 前台xaml代码如下: <Grid x:Name=" ...