标签:hdu1234
3 1 ME3021112225321 00:00:00 23:59:59 2 EE301218 08:05:35 20:56:35 MA301134 12:35:45 21:40:42 3 CS301111 15:30:28 17:00:10 SC3021234 08:00:00 11:25:25 CS301133 21:45:00 21:58:40
ME3021112225321 ME3021112225321 EE301218 MA301134 SC3021234 CS301133
#include <stdio.h>
#include <string.h>
int main()
{
int t, n, h, m, s, u, v;
char tmp[20], s1[20], s2[20];
scanf("%d", &t);
while(t--){
scanf("%d", &n);
u = 99999; v = -1;
while(n--){
scanf("%s%d:%d:%d", tmp, &h, &m, &s);
s += h * 60 * 60 + m * 60;
if(s < u){
u = s; strcpy(s1, tmp);
}
scanf("%d:%d:%d", &h, &m, &s);
s += h * 60 * 60 + m * 60;
if(s > v){
v = s; strcpy(s2, tmp);
}
}
printf("%s %s\n", s1, s2);
}
return 0;
}标签:hdu1234
原文地址:http://blog.csdn.net/chang_mu/article/details/38893577