| 比赛 | 不平凡的世界 | 评测结果 | AAATTTTTTT | 
    | 题目名称 | 不平凡的boss | 最终得分 | 30 | 
    | 用户昵称 | NVIDIA | 运行时间 | 7.165 s | 
    | 代码语言 | C++ | 内存使用 | 1.46 MiB | 
    | 提交时间 | 2015-11-05 11:05:19 | 
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#define maxn 100010
using namespace std;
int A[maxn]={0},B[maxn]={0},C[maxn]={0},i,j,k,ans=989999999,N;
bool diyitizhemokengdienizaomang(int a,int b,int c)
{
	for(int i=1;i<=N;i++)
	{
		if(A[i]>a&&B[i]>b&&C[i]>c) return false;
	}
	return true;
}
int main()
{
	freopen("playwithboss.in","r",stdin);
	freopen("playwithboss.out","w",stdout);
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
      scanf("%d%d%d",&A[i],&B[i],&C[i]);
      for(int i=0;i<=N;i++)
	{
		if(A[i]>ans) continue;
		for(int j=0;j<=N;j++)
		{
			if(A[i]+B[j]>ans) continue;
			for(int k=0;k<=N;k++)
			{
				if(A[i]+B[j]+C[k]>ans) continue;
				if(diyitizhemokengdienizaomang(A[i],B[j],C[k])) ans=A[i]+B[j]+C[k];
			}
		}
	}
	printf("%d",ans);
	return 0;
}