2 2 2000 30 123456789 2000 20 987654321 4 3000 50 872198442 3000 45 752498124 2000 60 765128742 3000 45 652278122
987654321 752498124
#include<stdio.h>
//#include<stdlib.h>
int
main(){
int test,a,b,c,x,y,z,m,i;
scanf("%d",&test);
while(test--){
scanf("%d",&m);
scanf("%d %d
%d",&a,&b,&c);
for(i=1;i<m;i++){
scanf("%d %d
%d",&x,&y,&z);
if(x>a||x==a&&y<b||x==a&&y==b&&z>c){
a=x;
b=y;
c=z;
}
}
printf("%d\n",c);
}
//system("pause");
return
0;
}
这是参考而来。
原文:http://www.cnblogs.com/dreamgoing/p/3587227.html