标签:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1234
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12183 Accepted Submission(s):
6157
1 #include <iostream> 2 #include <cstdio> 3 4 using namespace std; 5 6 int main () 7 { 8 int a,b,c,d,e,f,t,N,i,min,max,mint,maxt; 9 char ch[1000][16]; 10 scanf ("%d",&t); 11 while (t--) 12 { 13 min=999999,max=0,mint=0,maxt=0; 14 scanf ("%d",&N); 15 for (i=0; i<N; i++) 16 { 17 scanf ("%s%d:%d:%d%d:%d:%d",ch[i],&a,&b,&c,&d,&e,&f); 18 if(a*3600+b*60+c<min) 19 { 20 min=a*3600+b*60+c; 21 mint=i; 22 } 23 if (d*3600+e*60+f>max) 24 { 25 max=d*3600+e*60+f; 26 maxt=i; 27 } 28 } 29 printf ("%s %s\n",ch[mint],ch[maxt]); 30 } 31 return 0; 32 }
标签:
原文地址:http://www.cnblogs.com/qq-star/p/4623014.html