Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12296 Accepted Submission(s): 6222
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
以前写的代码。。感觉自己好机智。。不会结构体排序就写了这种奇葩代码还写对了~~除了有点长别的还真没啥23333~~~其实行数也不多~~我觉得按照以前的渣渣水平这个还是阔以的~~以后有机会再补上吧~~
#include<stdio.h> #include<string.h> int main(){ int m,n; char id[16],openid[16],closeid[16],opentime[9],closetime[9],open[9],close[9]; scanf("%d",&n); while(n--){ scanf("%d",&m); scanf("%s%s%s",&id,&open,&close); strcpy(opentime,open); strcpy(closetime,close); strcpy(openid,id); strcpy(closeid,id); m--; while(m--){ scanf("%s%s%s",&id,&open,&close); if(strcmp(opentime,open)>0){ strcpy(opentime,open); strcpy(openid,id); } if(strcmp(closetime,close)<0){ strcpy(closetime,close); strcpy(closeid,id); } } printf("%s %s\n",openid,closeid); } return 0; }