hdu 1069
来源:互联网 发布:淘宝欧时力旗舰店真假 编辑:程序博客网 时间:2024/06/05 07:36
#include <cstdio>#include <cstring>#include <queue>#include <iostream>#include <algorithm>using namespace std;const int N=200;int dp[N];struct node{ int x,y,z; node() {} node(int a, int b, int c): x(a), y(b), z(c) {} bool operator > (node &other) const { return (x>other.x && y>other.y); }}v[N];bool cmp(const node &a, const node &b){ return ( a.x>b.x || (a.x==b.x && a.y>b.y) );}int main(){ // freopen("in","r",stdin); // freopen("out","w",stdout); int i,j,a,b,c,n,m,ans,th=1; while( scanf("%d",&n) && n ) { memset(dp,0,sizeof(dp)); for(i=m=0;i<n;i++) { scanf("%d%d%d",&a,&b,&c); v[m]=node(a,b,c); v[m+1]=node(a,c,b); v[m+2]=node(b,c,a); v[m+3]=node(c,a,b); v[m+4]=node(b,a,c); v[m+5]=node(c,b,a); m+=6; } sort(v,v+m,cmp); for(i=0;i<m;i++) dp[i]=v[i].z; for(i=0;i<m;i++) for(j=0;j<m;j++){ if(v[i]>v[j]) dp[j]=max(dp[j],dp[i]+v[j].z); } ans=0; for(i=0;i<m;i++) ans=max(ans,dp[i]); printf("Case %d: maximum height = %d\n",th++,ans); } return 0;}
0 0
- hdu 1069
- HDU 1069
- HDU 1069
- HDU 1069
- HDU 1069
- hdu 1069
- hdu 1069
- hdu 1069
- HDU 1069
- hdu 1069
- hdu 1069
- hdu 1069
- hdu 1069
- HDU 1069
- hdu 1069
- hdu-1069
- hdu 1069
- HDU 1069
- 黑马程序员--List集合
- java设置背景图片
- HIVE常用语句
- Android系统中长按事件的实现机制解析
- BZOJ1084
- hdu 1069
- gcc 头文件查找路径
- chapter7 指针与引用
- unity3d从零开始(四):了解Script
- LeetCode-Validate Binary Search Tree
- 【HDU】4135 Co-prime 容斥原理
- strcpy 与 自己 赋值的 区别 (new)
- Matlab实例学习-----------格式化文本 读 操作
- 题目1190:大整数排序