hdu 1069
//Accepted 264 KB 0 ms //每种block只有三种方法,且每种放法至多放一次 //规定三条边的顺序后 //把所有的block按x递增排序,x相同则按y递增排序 //然后dp //dp[i]=max(dp[i],dp[j]+height[i]) i可以放到j上 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; ; struct node { int x,y,z; }p[*imax_n]; *imax_n]; int n; int max(int a,int b) { return a>b?a:b; } int min(int a,int b) { return a<b?a:b; } void Dp() { memset(dp,,sizeof(dp)); ;i<=*n;i++) { ;j<i;j++) if (p[j].x<p[i].x && p[j].y<p[i].y) dp[i]=max(dp[i],dp[j]+p[i].z); } ; ;i<=*n;i++) ans=max(ans,dp[i]); printf("%d\n",ans); } int cmp(struct node p1,struct node p2) { ; if (p1.x==p2.x) { ; } ; } int main() { ; while (scanf("%d",&n),n) { ;i<=n;i++) { int x,y,z; scanf("%d%d%d",&x,&y,&z); p[*i-].x=min(x,y); p[*i-].y=max(x,y); p[*i-].z=z; p[*i-].x=min(x,z); p[*i-].y=max(x,z); p[*i-].z=y; p[*i].x=min(y,z); p[*i].y=max(y,z); p[*i].z=x; } sort(p+,p+*n+,cmp); printf("Case %d: maximum height = ",++t); Dp(); } ; }
hdu 1069的更多相关文章
- HDU 1069 dp最长递增子序列
B - Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I6 ...
- HDU 1069&&HDU 1087 (DP 最长序列之和)
H - Super Jumping! Jumping! Jumping! Time Limit:1000MS Memory Limit:32768KB 64bit IO Format: ...
- HDU 1069 Monkey and Banana(二维偏序LIS的应用)
---恢复内容开始--- Monkey and Banana Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...
- 怒刷DP之 HDU 1069
Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 1069 Monkey and Banana (DP)
Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 1069 Monkey and Banana / ZOJ 1093 Monkey and Banana (最长路径)
HDU 1069 Monkey and Banana / ZOJ 1093 Monkey and Banana (最长路径) Description A group of researchers ar ...
- (最大上升子序列)Monkey and Banana -- hdu -- 1069
http://acm.hdu.edu.cn/showproblem.php?pid=1069 Monkey and Banana Time Limit:1000MS Memory L ...
- hdu 1069 动规 Monkey and Banana
Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u ...
- HDU 1069—— Monkey and Banana——————【dp】
Monkey and Banana Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u S ...
- HDU 1069 Monkey and Banana dp 题解
HDU 1069 Monkey and Banana 纵有疾风起 题目大意 一堆科学家研究猩猩的智商,给他M种长方体,每种N个.然后,将一个香蕉挂在屋顶,让猩猩通过 叠长方体来够到香蕉. 现在给你M种 ...
随机推荐
- [转]Android 5.0——Material Design详解(动画篇)
Material Design:Google推出的一个全新的设计语言,它的特点就是拟物扁平化. Material Design包含了很多内容,今天跟大家分享一下Material新增的动画: 在Andr ...
- 多路由器环境下路由器的入口IP地址及DHCP设置探讨
多路由器环境下路由器的入口IP地址及DHCP设置探讨 这里把路由器的LAN口管理IP地址称为路由器的入口地址,把直接接入互联网的路由器称为主路由器,其他路由器称为从路由器.在多路由器环境下路由器的设置 ...
- nodeschool.io 3
~~ MY FIRST I/O! ~~ Write a program that uses a single synchronous filesystem operation toread a fil ...
- 数据库中Schema(模式)概念的理解
在学习SQL的过程中,会遇到一个让你迷糊的Schema的概念.实际上,schema就是数据库对象的集合,这个集合包含了各种对象如:表.视图.存储过程.索引等.为了区分不同的集合,就需要给不同的集合起不 ...
- Linux下如何查看自己的服务器有没有无线网卡
还是实验室那台破服务器,连不上网.有没有界面,所以想着如何用一些命令来链接上热点. 当然,在linux下链接wifi没有win下那么一点就好了! 首先我们需要的基本条件就是: 服务器上有无线网卡.[r ...
- DataTable 中Distinct操作
DataTable dt = ds.Tables[]; DataView dataView = dt.DefaultView; DataTable dtDistinct = dataView.ToTa ...
- JSP生成条形码
下载barcode4j-2.0-bin.zip 目前最新版本是2.0, 解压barcode4j-2.0-bin.zip, 将其中的\lib\avalon-amework-4.2.0.jar和\bui ...
- PHP的那些坑
1.urlencode urlencode编码的对象必须是utf-8编码.如果是其它格式的编码就会出现乱码. 2.array_merge 一般来说,array_merge就是把两个或两个以上的数组组合 ...
- Js数据类型之——Date
小猪曾经分享过一篇文章,主要是讲到后台使用c#将DataTime类型序列化到前台之后进行操作:具体请看传送门 今天小猪来分享在JS中的Data类型 类型说明 ECMAScript中的Data类型是在早 ...
- C#抽象类、抽象方法、抽象属性
定义 在C#中使用关键字 abstract 来定义抽象类和抽象方法. 不能初始化的类被叫做抽象类,它们只提供部分实现,但是另一个类可以继承它并且能创建它们的实例."一个包含一个或多个纯虚函数 ...