题目链接:http://poj.org/problem?id=2926
#include<cstdio>
#include<cstring>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
const int INF = 0x3f3f3f; float Max[]; //Max[i]表示第i种的最大;
float Min[];
int N; int main()
{
//freopen("E:\\acm\\input.txt","r",stdin);
cin>>N;
for(int i=;i<;i++){
Max[i] = -INF; Min[i] = INF;
}
while(N--){
float a[];
scanf("%lf %lf %lf %lf %lf",&a[],&a[],&a[],&a[],&a[]);
for(int i=;i<;i++){
float add = ;
for(int j=;j<=;j++)
if(<<j & i) add += a[j];
else add -= a[j];
Max[i] = max(Max[i],add);
Min[i] = min(Min[i],add);
}
}
float ans = ;
for(int i=;i<;i++){
ans = max(ans,Max[i]-Min[i]);
}
printf("%.2f\n",ans);
return ;
}