| 比赛 | 不平凡的世界 | 评测结果 | AAAAWAAAAW | 
    | 题目名称 | 不平凡的boss | 最终得分 | 80 | 
    | 用户昵称 | ABCD | 运行时间 | 1.445 s | 
    | 代码语言 | C++ | 内存使用 | 0.30 MiB | 
    | 提交时间 | 2015-11-05 10:36:32 | 
显示代码纯文本
#include<cstdio>
#include<algorithm>
#include<queue>
using namespace std;
struct po{
	int x,y,z;
	po(int x=0,int y=0,int z=0):x(x),y(y),z(z){}
	bool operator < (const po&a)const{
		return min(min(x,y),z)<min(min(a.x,a.y),a.z);
	}
};
priority_queue<po>q;
int main(){
	int x,y,z,i,j,k,m,n;
	freopen("playwithboss.in","r",stdin);
	freopen("playwithboss.out","w",stdout);
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d%d",&x,&y,&z);
		q.push(po(x,y,z));
	}
	po a;
	x=0;y=0;z=0;
	while(!q.empty()){
		a=q.top();
		q.pop();
		if(x>=a.x||y>=a.y||z>=a.z)continue;
		if(a.x-x<min(a.y-y,a.z-z))x=a.x;
		else if(a.y-y<min(a.x-x,a.z-z))y=a.y;
		else if(a.z-z<min(a.y-y,a.x-x))z=a.z;
	}
	printf("%d",x+y+z);
	fclose(stdin);
	fclose(stdout);
	return 0;
}