动态规划
文章平均质量分 90
galesaur_wcy
我们一起加油啊~~~~
展开
-
H - 命运(动态规划) 数塔问题
H - 命运穿过幽谷意味着离大魔王lemon已经无限接近了! 可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧! 命运大迷宫可以看成是一个两维的方格阵列,如下原创 2017-08-16 11:01:54 · 532 阅读 · 0 评论 -
J - 免费馅饼(动态规划)数塔
J - 免费馅饼都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但原创 2017-08-15 19:47:29 · 182 阅读 · 0 评论 -
E - Tickets HDU - 1260 (动态规划)
E - Tickets HDU - 1260 Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when co原创 2017-09-06 13:14:58 · 420 阅读 · 0 评论 -
C - New Year and Hurry CodeForces - 750A(动态规划)
Limak is going to participate in a contest on the last day of the 2016. The contest will start at 20:00 and will last four hours, exactly until midnight. There will ben problems, sorted by difficult原创 2017-09-08 16:11:35 · 311 阅读 · 0 评论 -
Brackets (区间dp)
Brackets We give the following inductive definition of a “regular brackets” sequence: the empty sequence is a regular...原创 2018-02-20 13:29:45 · 150 阅读 · 0 评论 -
区间dp
区间dp里面怎么写?For p:=1 to n do // p是区间长度,作为阶段。for i:=1 to n do // i是穷举的区间的起点beginj:=i+p-1; // j是 区间的终点,这样所有的区间就穷举完毕if j>n then break; // 这个if很关键。for k:= i to j-1 do // 状态转移,去推出 f[i,j]f[i , j]= max{f[ i...原创 2018-02-20 13:31:07 · 129 阅读 · 0 评论 -
You Are the One (区间dp)
You Are the One The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, T...原创 2018-02-21 21:55:24 · 255 阅读 · 0 评论 -
ACM动态规划总结(by utobe67)
动态规划一直是ACM竞赛中的重点,也是难点(对于我这种水平),因为该算法时间效率高,代码量少,多元性强、灵活度高,主要考察思维能力、建模抽象能力。学了这么久动态规划,虽然还只是个菜菜= =,但还是想总结一下,总得给学弟学妹留下一些什么吧。 ...转载 2018-02-23 20:47:38 · 235 阅读 · 0 评论 -
Bookshelf 2 POJ - 3628(01背包||DFS)
Bookshelf 2 POJ - 3628 Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickl...原创 2018-03-31 14:29:14 · 127 阅读 · 0 评论 -
Hurdles of 110m ZOJ - 2972 (简单DP)
Hurdles of 110m ZOJ - 2972 我..脑子秀逗了 测试的时候都没有想到 真的是有够..........#include<bits/stdc++.h>using namespace std;struct node{ int t1,t2,t3; int f1,f3;}s[115];const int INF=0x3f3f3f3f;int dp[115]...原创 2018-04-18 17:00:33 · 146 阅读 · 0 评论 -
Dream City ZOJ - 3211(排序01背包)
JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n. At the first day, each tree i has ai coins on it (i=...转载 2018-04-23 09:59:09 · 130 阅读 · 0 评论 -
51Nod - 1086 (多重背包+2进制优化)
有N种物品,每种物品的数量为C1,C2......Cn。从中任选若干件放在容量为W的背包里,每种物品的体积为W1,W2......Wn(Wi为整数),与之相对应的价值为P1,P2......Pn(Pi为整数)。求背包能够容纳的最大价值。 Input 第1行,2个整数,N和W中间用空格隔开。N为物品的种类,W为背包的容量。(1 <= N <= 10...原创 2018-05-20 20:45:26 · 171 阅读 · 0 评论 -
删数问题 山东理工oj2072(贪心)
删数问题Time Limit: 1000 ms Memory Limit: 65536 KiBProblem Description 键盘输入一个高精度的正整数n(≤100位),去掉其中任意s个数字后剩下的数字按照原来的左右次序组成一个新的正整数。编程对给定的n与s,寻找一种方案,使得剩下的数字组成的新数最小。Input 输入有多组 每组包括原始数n,要去掉的数字数s;O...原创 2018-11-21 18:55:31 · 223 阅读 · 0 评论 -
K - 最少拦截系统(动态规划)
K - 最少拦截系统某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里来求救了,转载 2017-08-15 14:14:35 · 342 阅读 · 0 评论 -
HDU - 3466 (01背包+sort排序)
Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still very proud even if their n原创 2017-09-03 20:42:10 · 263 阅读 · 0 评论 -
E - Longest Ordered Subsequence(动态规划)最长升成子序列问题
E - Longest Ordered Subsequence A numeric sequence of ai is ordered if a1 a2 aN. Let the subsequence of the given numeric seque原创 2017-08-14 20:46:33 · 507 阅读 · 0 评论 -
H - Piggy-Bank (动态规划)(完全背包问题)
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple原创 2017-08-16 21:53:03 · 213 阅读 · 0 评论 -
D - Ignatius and the Princess IV (动态规划)
D - Ignatius and the Princess IV"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a spec原创 2017-08-17 10:32:38 · 278 阅读 · 0 评论 -
Bing it(动态规划)dp
A - Bing it题目 转载来自://http://www.cnblogs.com/acm_record/p/4759068.html嗯嗯嗯.......做这题昨晚看了下题目不懂是什么意思今天早上又看了一次还是不懂题目到底是什么意思 然后就去百度了 跟着人家的博客才知道这个题目是什么意思 意思就是说 如果有遇到相同的话那么就总和加转载 2017-08-17 13:28:49 · 263 阅读 · 0 评论 -
G - Super Jumping! Jumping! Jumping!(动态规划)
G - Super Jumping! Jumping! Jumping!Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I转载 2017-08-17 19:52:26 · 272 阅读 · 0 评论 -
B - Vacations(动态规划)
Vasya has n days of vacations! So he decided to improve his IT skills and do sport. Vasya knows the following information about each of thisn days: whether that gym opened and whether a contest was转载 2017-08-17 15:21:52 · 185 阅读 · 0 评论 -
CodeForces - 106C (多重背包转换为01背包)
CodeForces - 106CLavrenty, a baker, is going to make several buns with stuffings and sell them.Lavrenty has n grams of dough as well asm different stuffing types. The stuffing types are转载 2017-08-18 20:32:41 · 280 阅读 · 0 评论 -
A - 饭卡(动态规划 01背包)
A饭卡:电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。 Input 多组数据。对于每组数据原创 2017-08-14 14:56:19 · 368 阅读 · 1 评论 -
I - 数塔(动态规划)数塔问题
I - 数塔在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高原创 2017-08-14 16:24:45 · 484 阅读 · 0 评论 -
C - Bone Collector(背包问题)(01背包)
C - Bone CollectorMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the原创 2017-08-14 18:45:13 · 557 阅读 · 0 评论 -
B - Big Event in HDU(背包问题01背包)
B - Big Event in HDUNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Soft转载 2017-08-14 19:08:18 · 287 阅读 · 0 评论 -
B - Big Event in HDU(背包问题多重背包)
B - Big Event in HDUNowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into Computer College and Soft转载 2017-08-14 19:50:22 · 267 阅读 · 0 评论 -
最长上升子序列(LIS)长度的O(nlogn)算法 (动态规划)
转载来自http://blog.csdn.net/shuangde800/article/details/7474903很详细啊 hdu 1950 Bridging signalshttp://acm.hdu.edu.cn/showproblem.php?pid=1950===================================最长上升子序列(LIS)的转载 2017-08-14 20:28:43 · 340 阅读 · 0 评论 -
多元Huffman编码问题
算法作业:当 样例为 7 5 --------- 5 9 12 13 16 22 45的时候那么 最小值应该是148 ,但是如果按照我们的贪心算法是先将最小的情况合并的话 那么就会出错。合并为 5 9 12 13 16 。。。。。然后 55 + 22 + 45 = 122+55 = 177 那就错了所以我们改下。。。。5 9 12 先合并为26 然后13 16 22 26 45 再...原创 2018-11-23 15:17:12 · 2515 阅读 · 2 评论