HDU 1069 Monkey and Banana ——(DP)】的更多相关文章

题目链接 Problem Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever enough, it s…
简单DP. 题意:给出若干种长方体,如果摆放时一个长方体的长和宽小于另一个的长宽,那么它可以放在另一个的上面,问最高能放多少高度.每种长方体的个数都是无限的. 做法:因为每种个数都是无限,那么每种按照x,y,z分别重新排列可以得到6种长方体.现在用dp[i]表示选到第i个且第i个必须使用的最大高度,那么转移是从1~i-1中的dp中选一个能放在i的前面的最大值放在i的前面,再加上第i个的高,就得到了dp[i](如果一个都不能放在i的前面,那就只放i即可).然后最终答案是dp[1]~dp[n]的最大…
Monkey and Banana Problem Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monkey is clever…
题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=1069 题意描述: 给n块砖,给出其长,宽和高 问将这n块砖,怎样叠放使得满足以下条件使得高度最高,是多少 条件:A砖要放在B砖上,必须满足,A的长和宽都同时小于B的长和宽. 解题思路: 首先给出的n块砖有6种摆放方法,但是有两两的摆放方式情况下,他们的高是一样的,那么只用选取一种即可,那么一块砖可以有3种摆放方法. 先将三条边进行一个排序,找出不同高的三种砖记录,再对所有这些砖进行一个…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069 简单记录一下 思路:把长方体的各种摆法都存到数组里面,然后按照长宽排序,再dp即可 转移方程 dp[i]=max(dp[i],dp[t]+a[i].z) //dp里存的是高度,a[i].z是第i个的高度 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring>…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1069 Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18739    Accepted Submission(s): 9967 Problem Description A group of researc…
Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19928    Accepted Submission(s): 10609 Problem Description A group of researchers are designing an experiment to test the IQ of…
---恢复内容开始--- Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 13003    Accepted Submission(s): 6843 Problem Description A group of researchers are designing an experiment to te…
Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 24147    Accepted Submission(s): 12938 Problem Description A group of researchers are designing an experiment to test the IQ of…
题目链接:Monkey and Banana 大意:给出n种箱子的长宽高.每种不限个数.可以堆叠.询问可以达到的最高高度是多少. 要求两个箱子堆叠的时候叠加的面.上面的面的两维长度都严格小于下面的. 简单的DP,依然有很多地发给当时没想到.比如优先级,比如这么简单粗暴的选择. /* 大意是.给出n种箱子的长宽高.每种不限个数.可以堆叠.询问可以达到的最高高度是多少. 要求两个箱子堆叠的时候叠加的面.上面的面的两维长度都严格小于下面的. 样例: 10 20 30 10 20 10 30 20 30…