标签:
1.uva 12709 Falling ANTS
首先按照H排序,然后按照L*H*W排序
1 #include<iostream> 2 #include<cstdio> 3 #include <math.h> 4 #include<algorithm> 5 #include<string.h> 6 #define maxn 100009 7 #define inf 100000 8 using namespace std; 9 int main() 10 { 11 int n,a,b,c; 12 while(1) 13 { 14 int ans=0,ans_h=0; 15 scanf("%d",&n); 16 if(n==0)break; 17 for(int i=1;i<=n;i++) 18 { 19 scanf("%d%d%d",&a,&b,&c); 20 if(c>ans_h)ans_h=c,ans=a*b*c; 21 else if(c==ans_h && a*b*c>ans)ans=a*b*c; 22 } 23 printf("%d\n",ans); 24 } 25 return 0; 26 }
标签:
原文地址:http://www.cnblogs.com/philippica/p/4272546.html