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种 ...
随机推荐
- 素定位器(ElementLocators)
元素定位器(ElementLocators)告诉Selenium是向HTML中的哪一个元素发送命令.一个定位器的格式如下:locatorType=argument 我们支持如下写法用于定位元素:ide ...
- robotframework笔记4
机器人框架概述 机器人框架是一个通用的开源的自动化测试框架 验收测试和验收测试驱动开发(ATDD).它具有易于使用的表格的测试数据 语法采用关键字驱动 测试方法.其检测能力可以通过测试库 用Pyt ...
- Compound Interest Calculator1.0
Compound Interest Calculator1.0 客户说:帮我开发一个复利计算软件. 计算:本金为100万,利率或者投资回报率为3%,投资年限为30年,那么,30年后所获得的利息收入:按 ...
- Qt之QRadioButton
简述 QRadioButton部件提供了一个带有文本标签的单选框(单选按钮). QRadioButton是一个可以切换选中(checked)或未选中(unchecked)状态的选项按钮.单选框通常呈现 ...
- ubuntu14 eclipse luna 无法显示菜单 , 解决方案
使用命令行 , 输入 Exec=env UBUNTU_MENUPROXY=0 <eclipse的安装路径>/eclipse 就可以了 或者建立一个Eclipse的快捷方式,eclipse. ...
- js正则标志/g /i /m的用法,以及实例
js正则标志/g /i /m的用法,以及实例 正则的思想都是一样的,但是具体的写法会有所不同,在这里提到的/g,/i,/m在其他的地方也许就不能用了. 一,js正则标志/g,/i,/m说明 1,/ ...
- SQL的常用语句
select * from g_members where id between '16' and '31' order by id desc 倒序排列 select * from g_members ...
- 创建PO/SO
IF P_ZY EQ 'X'."直营订单 调拨单 PERFORM FRM_INIT_PO_HEADER. PERFORM FRM_INIT_PO_ITEM. PERFORM FRM_INIT ...
- WebDataTree 使用XML做数据源绑定数据
英文版原文链接:http://www.infragistics.com/help/topic/e5f07b51-ee2d-4a33-aaac-2f43cffff327 所使用的控件版本为:Infrag ...
- GridView72变 控件
快速预览:GridView 无代码分页排序GridView选中,编辑,取消,删除GridView正反双向排序GridView和下拉菜单 DropDownList结合GridView和CheckBox结 ...