HDU 1069 基础动态规划+排序】的更多相关文章

题意 给出n种立方体石头 当且仅当一块石头的底部宽度长度都小于一块石头的时候才能放在上面 问最高能放多高?石头不限数目 然而同样一种石头采用同样的摆放方式 两快相同石头一定无法进行放置 所以 一块石头的一种摆放方式最多使用一次 进行一下排序 让长与宽最小的放在最前面 然后就是可爱的dp模板了 #include<stdio.h> #include<string.h> #include<algorithm> #include<map> #include<m…
HDU 1069 Monkey and Banana / ZOJ 1093 Monkey and Banana (最长路径) 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…
HDU 1069 Monkey and Banana 纵有疾风起 题目大意 一堆科学家研究猩猩的智商,给他M种长方体,每种N个.然后,将一个香蕉挂在屋顶,让猩猩通过 叠长方体来够到香蕉. 现在给你M种长方体,计算,最高能堆多高.要求位于上面的长方体的长要大于(注意不是大于等于)下面长方体的长,上面长方体的宽大于下面长方体的宽. 输入输出 开始一个数n,表示有多少种木块,木块的数量无限,然后接下来的n行,每行3个数,是木块的长宽高三个参量 输出使用这些在满足条件的情况下能够摆放的最大高度 解题思路…
H - Super Jumping! Jumping! Jumping! Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1087 Appoint description:  System Crawler  (2015-11-18) Description Nowadays, a kind of chess game called “Su…
Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the r…
B - Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Appoint description: Description A group of researchers are designing an experiment to test the IQ of a monkey. They wi…
---恢复内容开始--- 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:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Appoint description:  prayerhgq  (2015-08-04) System Crawler  (2015-09-05) Description A group of researchers are designing…
Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the r…
http://acm.hdu.edu.cn/showproblem.php?pid=1069      Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Description A group of researchers are designing an experiment to test…
如果我们规定当局面中所有的单一游戏的SG值为0时,游戏结束,则先手必胜当且仅当:(1)游戏的SG!=0 && 存在单一游戏的SG>1:(2)游戏的SG==0  && 任意单一游戏的SG==0. /** @Date : 2017-10-15 01:49:12 * @FileName: HDU 2509 基础anti-sg.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link…
翻硬币游戏,任意选3个,最右边的一个必须是正面.不能操作者败. 基本模型..不太可能自己推 还是老实记下来吧..对于单个硬币的SG值为2x或2x+1,当该硬币的位置x,其二进制1的个数为偶数时,sg=2x+1否则为2x LINK /** @Date : 2017-10-14 23:13:21 * @FileName: HDU 3537 基础翻硬币模型 向NIM转化.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com…
基础的bash博弈,两人捐钱,每次不超过m,谁先捐到n谁胜. 对于一个初始值n,如果其不为(m+1)的倍数,那么先手把余数拿掉,后继游戏中不管如何,后手操作后必定会有数余下,那么先手必胜,反之后手必胜. /** @Date : 2017-10-13 22:01:49 * @FileName: HDU 2188 基础Bash.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://g…
普通的NIM,然后问先手必胜第一次操作后的所有局面. 对于一个必胜局面只要转变局面SG值为必败(SG=0)留给后手就行了. /** @Date : 2017-10-13 21:39:13 * @FileName: HDU 2176 基础NIM 输出方案.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #inc…
 Monkey and Banana Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1069 Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the…
HDU.2647 Reward(拓扑排序 TopSort) 题意分析 裸的拓扑排序 详解请移步 算法学习 拓扑排序(TopSort) 这道题有一点变化是要求计算最后的金钱数.最少金钱值是888,最少的差额是1,如1号的人比2号钱要多,2号至少是1号人的钱数+1.根据拓扑排序的思想,我们只需要类比二叉树的层序遍历,每次取出入度为0的节点做处理,累加金钱数量,然后再取出入度为0的节点处理.直到取出所有的点或者判断成环即可. 代码总览 #include <iostream> #include <…
拓扑排序基础 拓扑排序用于解决有向无环图(DAG,Directed Acyclic Graph)按依赖关系排线性序列问题,直白地说解决这样的问题:有一组数据,其中一些数据依赖其他,问能否按依赖关系排序(被依赖的排在前面),或给出排序结果. 最常用解决拓扑排序问题的方法是Kahn算法,步骤可以概括为: . 根据依赖关系,构建邻接矩阵或邻接表.入度数组 . 取入度为0的数据(即不依赖其他数据的数据),根据邻接矩阵/邻接表依次减小依赖其的数据的入度 . 判断减小后是否有新的入度为0的数据,继续进行第2…
算法基础~链表~排序链表的合并(k条) 1,题意:已知k个已排序链表头结点指针,将这k个链表合并,合并后仍然为有序的,返回合并后的头结点. 2,方法之间时间复杂度的比较: 方法1(借助工具vector封装好的sort方法):将k * n个结点放到vector,则原 vector的排序时间复杂度是 O(nlogn); 有k*n个结点的排序,时间复杂度是 O(knlog(kn)); 方法2(分制后相连法),分制:这里咱要想到高中的DNA复制~一个DNA复制生成K个DNA的过程. [1----复制--…
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目链接按分类爬下来,然后根据题目的AC数目来作为难度指标进行从易到难的排序: POJ       题目标号  通过数 搜索: 1011 336071664 201111321 197841753 185021979 182532386 161761742 122131915 120101579 950…
链接: http://acm.hdu.edu.cn/showproblem.php?pid=1069 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=87813#problem/E 代码: ///此题目考察到动态规划里的最长有序子序列 #include<stdio.h> #include<string.h> #include<math.h> #include<queue> #include<a…
题目链接: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>…
Monkey and Banana Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10987    Accepted Submission(s): 5732 Problem Description A group of researchers are designing an experiment to test the IQ of a…
题目 题意:研究人员要测试猴子的IQ,将香蕉挂到一定高度,给猴子一些不同大小的箱子,箱子数量不限,让猩猩通过叠长方体来够到香蕉. 现在给你N种长方体, 要求:位于上面的长方体的长和宽  要小于  下面长方体的长和宽. 思路:对于一种长方体,长宽高(a,b,c)有6总不同的组成方式{(a,b,c),(a,c,b),(b,a,c),(b,c,a),(c,a,b),(c,b,a) },对所有组成方式的长方体从小到大排序,比较满足长1<长2,宽1<宽2,的最大高度. dp[i]: 表示第i个盒子的高…
题目链接:Monkey and Banana 大意:给出n种箱子的长宽高.每种不限个数.可以堆叠.询问可以达到的最高高度是多少. 要求两个箱子堆叠的时候叠加的面.上面的面的两维长度都严格小于下面的. 简单的DP,依然有很多地发给当时没想到.比如优先级,比如这么简单粗暴的选择. /* 大意是.给出n种箱子的长宽高.每种不限个数.可以堆叠.询问可以达到的最高高度是多少. 要求两个箱子堆叠的时候叠加的面.上面的面的两维长度都严格小于下面的. 样例: 10 20 30 10 20 10 30 20 30…
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 直接写中文了 Problem Statement 一组研究人员正在设计一项实验,以测试猴子的智商.他们将挂香蕉在建筑物的屋顶,同时,提供一些砖块给这些猴子.如果猴子足够聪明,它应当能够通过合理的放置一些砖块建立一个塔,并爬上去吃他们最喜欢的香蕉.   研究人员有n种类型的砖块,每种类型的砖块都有无限个.第i块砖块的长宽高分别用xi,yi,zi来表示. 同时,由于砖块是可以旋转的,每个砖块的3条边可以组成6种不同的长宽高.   在构建塔时,当且仅当A砖块的长和宽…
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 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 so…
题目链接: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…