#include <stdio.h>
typedef struct pNode {
char id[20];
int hh, mm, ss;
}pNode;
bool great(pNode a, pNode b) {
if(a.hh != b.hh) return a.hh > b.hh;
if(a.mm != b.mm) return a.mm > b.mm;
return a.ss > b.ss;
}
int main(int argc, char *argv[]) {
pNode temp, ans1, ans2;
int M;
scanf("%d", &M);
ans1.hh = 24, ans1.mm = 60, ans1.ss = 60;
ans2.hh = 0, ans1.mm = 0, ans1.ss = 0;
for(int i=0; i<M; i++) {
scanf("%s %d:%d:%d", temp.id, &temp.hh, &temp.mm, &temp.ss);
if(great(temp, ans1) == false) ans1 = temp;
scanf("%d:%d:%d", &temp.hh, &temp.mm, &temp.ss);
if(great(temp, ans2) == true) ans2 = temp;
}
printf("%s %s", ans1.id, ans2.id);
}
1006 Sign In and Sign Out (25 分)
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 题目 1006 Sign In and Sign Out (25 分)At the beginning of ev...
- 题目信息 At the beginning of every day, the first person who ...
- 这题是真的水了,竟然25分哈1006 Sign In and Sign Out
- 我的PAT系列文章更新重心已移至Github,欢迎来看PAT题解的小伙伴请到Github Pages浏览最新内容。...