[HDU 1069 Monkey and Banana]DP

告别手动画图!用Cadence SKILL写一个参数化电感PCell(附完整代码) 本文详细介绍了如何使用Cadence SKILL语言开发参数化电感PCell,实现电感版图的自动化生成。通过动态调整线宽、圈数等几何参数,自动创建端口并进行工艺规则校验,大幅提升高频电路设计效率。附完整代码示例,帮助工程师快速掌握PCell开发技巧。 阅读详情

题目链接  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): 9902    Accepted Submission(s): 5152


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 shall be able to reach the banana by placing one block on the top another to build a tower and climb up to get its favorite food.

The researchers have n types of blocks, and an unlimited supply of blocks of each type. Each type-i block was a rectangular solid with linear dimensions (xi, yi, zi). A block could be reoriented so that any two of its three dimensions determined the dimensions of the base and the other dimension was the height.

They want to make sure that the tallest tower possible by stacking blocks can reach the roof. The problem is that, in building a tower, one block could only be placed on top of another block as long as the two base dimensions of the upper block were both strictly smaller than the corresponding base dimensions of the lower block because there has to be some space for the monkey to step on. This meant, for example, that blocks oriented to have equal-sized bases couldn't be stacked.

Your job is to write a program that determines the height of the tallest tower the monkey can build with a given set of blocks.
 

Input
The input file will contain one or more test cases. The first line of each test case contains an integer n,
representing the number of different blocks in the following data set. The maximum value for n is 30.
Each of the next n lines contains three integers representing the values xi, yi and zi.
Input is terminated by a value of zero (0) for n.
 

Output
For each test case, print one line containing the case number (they are numbered sequentially starting from 1) and the height of the tallest possible tower in the format "Case case: maximum height = height".
 

Sample Input
  
1 10 20 30 2 6 8 10 5 5 5 7 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 6 6 6 7 7 7 5 31 41 59 26 53 58 97 93 23 84 62 64 33 83 27 0
 

Sample Output
  
Case 1: maximum height = 40 Case 2: maximum height = 21 Case 3: maximum height = 28 Case 4: maximum height = 342
 

Source
 
其实蛮简单的,思考一下就可以了。
题目意思是给你n个长方体的长宽高,长方体能用各种姿态摆,也就是长能做宽宽能做高高能做长,随意变化。。。
每一种长方体的个数无限,稍微想想就知道一个长方体能摆3个姿势,长宽高能定6种。
然后让你把这些长方体像金字塔一样堆叠起来,上面的长方体要小于下面的长方体,宽和长都要小于下面长方体的宽和长,让你求出能摆出的最高高度。
其实就是最大子序列和,写出转移方程的条件就行。
我的做法是,每给你一个长方体的数据,就存6种长方体,然后按照长或者宽从小到大排序,用dp记录用当前长方体做低能堆叠出的最高高度。

代码如下
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
typedef struct node   //开个结构体数组,用来记录dp值和长宽高
{
    int x, y, z;
    int dp;
};
int cmp(node a, node b)
{
    return a.x < b.x;
}
node nod[185];
int n;
int main()
{
//    freopen("input.txt", "r", stdin);
    int s[3];
    int a, b, c;
    int cnt;
    int tt = 1;
    while (scanf("%d", &n) != EOF&&n)
    {
        cnt = 1;
        for (int i = 1; i <= n; i++)
        {
            scanf("%d%d%d", &s[0], &s[1], &s[2]);
            sort(s, s + 3);
            nod[cnt].x = s[0];    //冗长的储存。。。
            nod[cnt].y = s[1];
            nod[cnt].z = s[2];
            nod[cnt++].dp = s[2];
            nod[cnt].x = s[1];
            nod[cnt].y = s[0];
            nod[cnt].z = s[2];
            nod[cnt++].dp = s[2];
            nod[cnt].x = s[1];
            nod[cnt].y = s[2];
            nod[cnt].z = s[0];
            nod[cnt++].dp = s[0];
            nod[cnt].x = s[2];
            nod[cnt].y = s[1];
            nod[cnt].z = s[0];
            nod[cnt++].dp = s[0];
            nod[cnt].x = s[2];
            nod[cnt].y = s[0];
            nod[cnt].z = s[1];
            nod[cnt++].dp = s[1];
            nod[cnt].x = s[0];
            nod[cnt].y = s[2];
            nod[cnt].z = s[1];
            nod[cnt++].dp = s[1];
        }
        sort(nod, nod + cnt, cmp);  //按照宽或者长从小到大排序
        for (int i = 1; i < cnt; i++)
        {
            for (int j = 1; j < i; j++)
            {
                if (nod[i].x > nod[j].x && nod[i].y > nod[j].y)  //长/宽都要大于上面的长方体的长/宽
                    nod[i].dp = max(nod[i].dp, nod[j].dp + nod[i].z);
            }
        }
        int mx = -1;
        for (int i = 1; i < cnt; i++)   //取最大值
            mx = max(mx, nod[i].dp);
        printf("Case %d: maximum height = %d\n", tt++, mx);
    }
    return 0;
}



【知识分享】IBIS 建模指南 05 本文详细阐述了IBIS模型创建过程中的关键技术和数据规范要求。主要内容包括:1. 数据完整性检查要点,强调I-V和V-T数据必须覆盖所有工艺角且匹配;2. 数据限制处理方法,介绍100/1000点限制下的两种数据筛选算法;3. 特殊数据处理技术,包括内部终端电阻调整和V-T表时间窗口选择;4. 高级关键字应用,涵盖[ModelSelector]、[Sub model]、[DiffPin]等复杂功能实现方法;5. 预加重缓冲器等特殊结构的建模方案。 阅读详情

相关推荐

卫星图像检测,分割,跟踪,超分辨率,数据集调研,以及论文笔记

目标检测,针对物体有很多类如桥,烟囱,罐子等,有静态图像下的检测,也就是图像源头多来自谷歌地图,但是前后帧没有任何联系,并且谷歌地图相对来说比较清楚,难度小一点,也有粗粒度以及较细粒度的检测,然后卫星视频的数据集较少,则可以通过前后帧的联系来辅助检测,并且卫星帧基本上只对车,船,飞机,火车进行检测,没有进行细粒度的检测即将车辆分类为卡车,皮卡,小轿车,但是关船,则可以分类为货船以及军舰,因为目前的卫星视频中小车实在太少了,难以进行更细粒度的检测。luojia 三号卫星。

zhangzhao147的博客 4707

HDU1069-Monkey and Banana 【DP】

题目地址:https://cn.vjudge.net/problem/HDU-1069 看了一下这个DP教程,受到启发来做这题,一开始solve函数是这么写的 int solve() { getpre(); memset(dp,0,sizeof(dp)); dp[0][0] = 0; dp[0][1] = bl[0].c; for(int i=1;i&...

好好学习天天向上 3298

Zabbix7.0实践:专线线路监控场景1

本文介绍了专线互联线路远程Ping监控的实现方案。针对运营商中间设备导致端口状态无法真实反映线路通断的问题,提出通过脚本执行端到端Ping检测的方案。具体实现包括:1)使用Expect脚本登录设备执行Ping测试并格式化结果;2)通过Shell脚本处理线路信息并生成JSON格式数据;3)配置Zabbix监控系统,创建自动发现规则和监控项原型,实现线路状态的自动监控。该方案适用于专线数量不多但重要的场景,能够有效检测中间有运营商设备的专线线路通断状态,最终在Zabbix中实现可视化的告警展示。

2301_80016499的博客 781

HDU1069 Monkey and Banana (DP)

HDU1069 Monkey and Banana (DP) HDU1069 Monkey and Banana DP 题意 思路 AC代码 原题地址:http://acm.hdu.edu.cn/showproblem.php?pid=1069 题意 有n个小块,每个块能摆成6种方案,每个小块提供无数个,下一层的长宽都必须严格大于上一层的长与宽。问最高能够叠多高。 ...

HuiSeKongHuan的博客 390

数学分析五领域全景:实分析、复分析、泛函分析、傅里叶分析、凸分析

五种分析,五种视角,同一个目标。理解一个系统,首先要找到它的不变量。

li880862的博客 192

【感知模块算法】障碍物detect+trace+prediction方向介绍

系列文章目录 提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加 TODO:写完再整理 文章目录系列文章目录前言一、多维度看感知问题,体会复杂性二、障碍物/环境目标detect方向1.视觉目标检测方向(1)图像处理认知(2)视觉基础理论部分1、获取数据集---python网页爬虫、买数据、自己录数据、使用开源比赛的数据集2、opencv库的学习3、深度学习框架学习(3)视觉目标检测理论(1)目标检测的概念(2)目标检测的应用场景(3)现有目标检测框架原理及论文【这仅仅是我当初入门学习的框架~

qq_35635374的博客 2894

HDU 1069 Monkey and Banana dp 题解

HDU 1069 Monkey and Banana 题解 纵有疾风起 题目大意 一堆科学家研究猩猩的智商,给他M种长方体,每种N个。然后,将一个香蕉挂在屋顶,让猩猩通过 叠长方体来够到香蕉。 现在给你M种长方体,计算,最高能堆多高。要求位于上面的长方体的长要大于(注意不是大于等于)下面长方体的长,上面长方体的宽大于下面长方体的宽。 输入输出 开始一个数n,表示有多少种木块,木块...

weixin_30433075的博客 174

万字长文,YOLOv8 yaml 文件解析 | 一文搞定 YOLOv8 分类任务,检测任务,分割任务,关键点任务

YOLOv8 yaml 文件解析 | 一文搞定 YOLOv8 分类任务,检测任务,分割任务,关键点任务

Coding... 1万+

hdu 1069 Monkey and Banana DP

传送门:hdu 1069 Monkey and Banana题目大意一堆科学家研究猩猩的智商,给他M种长方体,每种N个。然后,将一个香蕉挂在屋顶,让猩猩通过 叠长方体来够到香蕉。现在给你M种长方体,计算,最高能堆多高。要求位于上面的长方体的长要小于(注意不是小于于等于)下面长方体的长,上面长方体的宽小于下面长方体的宽。解题思路每一种长宽高不同的箱子来说,最多有六种摆放方式, 把这六种摆放的样式全部

woshinannan的专栏 435

基于STM32设计的4G远程视频侦查小车(图传+远程控制+EMQX+MQTT)(204)

当前设计了一款基于STM32F103ZET6主控芯片和废旧Android手机改造的4G侦查小车。该设计充分利用已有的智能手机硬件资源,实现摄像头画面的实时采集与上传,以及远程控制功能。这样的设计不仅降低了成本,而且充分利用了废旧手机中高性能的硬件资源,如摄像头、4G通信模块和电池等,实现了资源的有效循环利用。

2529

Challenge 4 - OSCP A

在c盘下发现一个windows.old,在里面可以找到SYSTEM和SAM文件,下载到本地,利用samdump2解密发现没解出来,再来试试pwdump.py(https://github.com/CiscoCXSecurity/creddump7)得到压缩包密码bludecode,解压之后发现一个比较特殊的文件configuration.php,里面有两个类似密码的字符串。登录之后在/opt/backups/下发现几个特殊文件,其中sitebackup3.zip是个正常的压缩包。但是这个压缩包是有密码的。

羽的博客 5786

C - Monkey and Banana HDU - 1069——基础dp

Think: 1知识点:基础dp 2题意:询问n种箱子在满足 1>可以不同面为底 2>一个叠一个 3>叠的箱子中上面的箱子长和宽都严格小于下面的箱子的长和宽 4>无限个箱子 条件下能够叠的最高高度vjudge题目链接以下为Accepted代码——基础dp#include <cstdio> #include <cstring> #include <algorithm>using name

BlessingXRY的博客 505

SpringBoot一次请求中缓存数据,请求结束就清除的4种方法,你会几种?

通过以上四种方法,你可以在 SpringBoot 的一次请求中缓存数据,并在请求结束后自动清除这些缓存数据。使用 ThreadLocal:适用于需要跨多个方法调用的缓存数据,灵活性高,但需要注意内存泄漏问题。使用 AOP:适用于全局性的缓存管理,代码更加优雅,但需要对 AOP 有一定的了解。使用 ServletRequestListener:适用于简单的请求生命周期管理,配置简单,但功能相对有限。使用 HttpServletRequest 的 setAttribute 和 getAttribute。

java专栏 1295

ACM-经典DP之Monkey and Banana——hdu1069

  ***************************************转载请注明出处:http://blog.youkuaiyun.com/lttree*************************************** Monkey and Banana   Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 6553...

继续激情,继续奋斗。 7751

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

HDU1069 Monkey and Banana —— DP

题目链接:http://acm.split.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): 16589A...

alince20008的博客 161

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Linux文件系统详解:从基础概念到高级挂载技巧

文件系统是操作系统管理存储设备的核心机制,Linux采用独特的单一目录树结构组织存储资源。从底层原理看,文件系统通过超级块、inode表和目录项等组件实现数据的高效存取。ext4、XFS等主流文件系统类型各有特点,工程师需要根据性能需求、功能特性和兼容性要求进行选择。在实际应用中,通过mount命令和fstab配置可以实现灵活的挂载管理,而bind mount、tmpfs等高级技巧则能满足容器化、内存文件系统等特殊场景需求。文件系统性能优化涉及挂载选项调整、日志模式选择等多个维度,合理的配置可以显著提升数据

aofan9566的博客 321

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

[HDU 1069 DP]Monkey and Banana

方法1: dp[i][j]记为在第i层使用第j块block的最大高度。三重for循环: #include<bits/stdc++.h> #define pb push_back using namespace std; const int N = 95; int n; typedef long long ll; struct block{ int x,y,h; block(int _x,int _y,int _h):x(_x),y(_y),h(_h){ } }; vector<b

我们仍未知道那天所看见的花的名字。 124

HDU 1069 Monkey and Banana DP

Monkey and Banana Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u SubmitStatusDescription A group of researchers are designing an experiment to test the IQ of a mo

Katapeltes 597

HDU1069 Monkey and Banana DP

题意:给你一些不同的方块,每种方块可以用无限个,当上一方块的底面长宽都小于下一方块的底面时两方块可以叠在一起,求这些方块叠起来的最高高度 思路:由于方块可以翻转,故底面有六种情况,每种方块把六种情况都做考虑,取dp[i]为第i个方块为底的时最大高度,则dp[i]=block[i].z+max(dp[j]),0<j<i,即当前最大高度等于当前方块高度加上可以放在i上面的最大高度,求出每个...

qq_42397248的博客 189

HDU 1069 Monkey and Banana (DP)

DP

yohanlong的专栏 309

hdu 1069 Monkey and Banana dp

题意:给你n种个长方体,告诉你每种长方体的长,宽,高,并且每种长方体个数不限 问:把它们堆起来的最大高度 限制条件:上面一个长方体a的底面积,必须比它下面一个长方体b的底面积大,而且,a的底面的长宽也要大于b的底面的长宽 所以,b的底面积如果比a的底面积小,b也不一定能放在a上面 View Code #include <iostream>#include &l...

diaopi1575的博客 177

HDU 1069 Monkey and Banana(dp)

题目链接:HDU 1069 Monkey and Banana dp。 我认为这道题难点在于解决方块无限个的问题,转化到代码中就是一个方块变成六个方块。然后排序,剩下就简单了。 blocks[i].height表示第i个块在最底下时候的最大高度。 具体看代码吧。 #include #include #include using namespace std; const in

fobdddf的专栏 576

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 wit...

dianxuanzhi1019的博客 133

hdu1069 Monkey and Banana dp

题目链接:http://hdu.hustoj.com/showproblem.php?pid=1069                                                                                                                    Monkey and Banana Ti

一七得七 406

HDU 1069 Monkey and Banana Dp问题

题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=68966#problem/C 题意:给定一些长方体的尺寸,数量都是无限个,然后求这写长方体能堆切成的最大高度。PS:接触面的上面必须严格小于下面的面。 这题和紫书P269的巴比伦塔例题差不多,可以说是一模一样,紫书上把这种题型叫DAG上最长路。看了别人的代码AC的。 思路:

catch_catch的专栏 651

HDU1069 Monkey and Banana【基础DP】

Monkey and Banana 题意: 有n种类型的砖块,每种类型的砖块都有无限个。第i块砖块的长宽高分别用xi,yi,zi来表示。 同时,由于砖块是可以旋转的,每个砖块的3条边可以组成6种不同的长宽高。在构建塔时,当且仅当A砖块的长和宽都分别小于B砖块的长和宽时,A砖块才能放到B砖块的上面,计算最高可以堆出的砖块们的高度。 题解: 因为一块砖有六个形态,直接将每个形态确定为一种砖块,然后排好序(随便以什么依据,但一定要排好序)。要明确一点,是不能用贪心做的,因为也许在A砖上放置了B,不...

lllllan 166
上一篇: [HDU 2571 命运]简单DP
下一篇: [HDU 1171 Big Event in HDU]背包
chenningGo
博客等级 码龄11年 1粉丝 17原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值