# 开门人和关门人

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12199    Accepted Submission(s): 6163

Problem Description

Input

Output

Sample Input
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

Sample Output
ME3021112225321 ME3021112225321 EE301218 MA301134 SC3021234 CS301133

Source

1：水题

#include<stdio.h>
#include<string.h>
int main (void)
{
int d,i,j,cc,jj;
char a[100][18],b[100][10],c[100][10];
scanf("%d",&d);
while(d--)
{
scanf("%d",&cc);
for(i=0; i<cc; i++)
{
scanf("%s",a[i]);
scanf("%s",b[i]);
scanf("%s",c[i]);
}
j=0;
for(i=1; i<cc; i++)
{
if(((b[j][0]-'0')*10+b[j][1]-'0')>((b[i][0]-'0')*10+b[i][1]-'0'))
j=i;
else if(((b[j][0]-'0')*10+b[j][1]-'0')==((b[i][0]-'0')*10+b[i][1]-'0'))
{
if(((b[j][3]-'0')*10+b[j][4]-'0')>((b[i][3]-'0')*10+b[i][4]-'0'))
j=i;
else if(((b[j][3]-'0')*10+b[j][4]-'0')==((b[i][3]-'0')*10+b[i][4]-'0'))
{
if(((b[j][6]-'0')*10+b[j][7]-'0')>((b[i][6]-'0')*10+b[i][7]-'0'))
j=i;
}
}
}
jj=0;
for(i=1; i<cc; i++)
{
if(((c[jj][0]-'0')*10+c[jj][1]-'0')<((c[i][0]-'0')*10+c[i][1]-'0'))
jj=i;
else if(((c[jj][0]-'0')*10+c[jj][1]-'0')==((c[i][0]-'0')*10+c[i][1]-'0'))
{
if(((c[jj][3]-'0')*10+c[jj][4]-'0')<((c[i][3]-'0')*10+c[i][4]-'0'))
jj=i;
else if(((c[jj][3]-'0')*10+c[jj][4]-'0')==((c[i][3]-'0')*10+c[i][4]-'0'))
{
if(((c[jj][6]-'0')*10+c[jj][7]-'0')<((c[i][6]-'0')*10+c[i][7]-'0'))
jj=i;
}
}
}
printf("%s %s",a[j],a[jj]);
printf("\n");
}
return 0;
}


06-20 1652

12-06 110

12-16 157

04-19 506

09-05 3803

01-20 2931

10-23 360

07-22 242

11-10 217

01-02 624