动态规划_dp
Jianbagengmu
换了id,换了我的人生的态度.
展开
-
跳舞毯
由于长期缺乏运动,小黑发现自己的身材臃肿了许多,于是他想健身,更准确地说是减肥。小黑买来一块圆形的毯子,把它们分成三等分,分别标上A,B,C,称之为“跳舞毯”,他的运动方式是每次都从A开始跳,每次都可以任意跳到其他块,但最后必须跳回A,且不能原地跳.为达到减肥效果,小黑每天都会坚持跳n次,有天他突然想知道当他跳n次时共几种跳法,结果想了好几天没想出来-_-现在就请你帮帮他,算出总共有多少跳原创 2017-03-26 18:53:52 · 375 阅读 · 0 评论 -
Codeforces Round #442 (Div. 2) A. Alex and broken contest,B - Nikita and string
A. Alex and broken contest time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output One day Alex was creating a contest about his friends, but acci原创 2017-11-04 09:47:49 · 369 阅读 · 0 评论 -
zoj 1074 前缀和+dp
To the MaxGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole array. The sum of a rectangle is原创 2017-08-03 20:10:55 · 229 阅读 · 0 评论 -
hdu_1087_和做的上一个递推一样_简单_不必复习
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 introduc原创 2017-08-19 10:16:41 · 200 阅读 · 0 评论 -
poj_1611_模拟递推_刚做过类似
The SuspectsSevere acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strat原创 2017-08-17 16:35:58 · 210 阅读 · 0 评论 -
hdu_1078_FatMouse and Cheese_神奇的贪心_动态规划_算不上是dp
FatMouse and Cheese FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each原创 2017-08-16 22:03:27 · 242 阅读 · 0 评论 -
hdu1421
搬寝室 Time Limit: 1000msMemory Limit: 32768KB This problem will be judged on HDU. Original ID: 1421 64-bit integer IO format: %I64d Java class name: Main Prev Submit Status Statistics Next Type原创 2017-07-09 22:10:59 · 182 阅读 · 0 评论 -
hdu 1466
计算直线的交点数 Time Limit: 1000msMemory Limit: 32768KB This problem will be judged on HDU. Original ID: 1466 64-bit integer IO format: %I64d Java class name: Main Prev Submit Status Statistics Next原创 2017-07-20 21:42:05 · 194 阅读 · 0 评论 -
背包之01背包、完全背包、多重背包详解
背包之01背包、完全背包、多重背包详解PS:大家觉得写得还过得去,就帮我顶博客,谢谢。首先说下动态规划,动态规划这东西就和递归一样,只能找局部关系,若想全部列出来,是很难的,比如汉诺塔。你可以说先把除最后一层的其他所有层都移动到2,再把最后一层移动到3,最后再把其余的从2移动到3,这是一个直观的关系,但是想列举出来是很难的,也许当层数n=3时还可以模拟下,再大一些就不可能了,所以,转载 2017-07-04 16:17:11 · 233 阅读 · 0 评论 -
记忆化01背包 我爱洗衣服啊
I. 我爱洗衣服啊Zz 非常不喜欢洗衣服,原因就是Zz是一个非常惜时的人,他希望用洗衣服的时间来打代码。不存在的,Zz 就是懒! 由于为了节约大家的时间,学校特意安置了一台洗衣机,所以Zz 可以通过洗衣机来洗衣服,但是这台洗衣机每次只能洗一件衣服且对每件衣服的价格不同,所以学校是为了坑钱?(不存在的,题目背景需要)。 虽然Zz 非常惜时,但是当洗衣机在衣服的时候,他会选择休息,不会进行洗衣服,而原创 2017-05-20 16:55:53 · 387 阅读 · 0 评论 -
Aeroplane chess hdu 4405
Aeroplane chess Time Limit: 1000msMemory Limit: 32768KB This problem will be judged on HDU. Original ID: 4405 64-bit integer IO format: %I64d Java class name: Main Prev Submit Status Statistics原创 2017-05-31 14:55:26 · 211 阅读 · 0 评论 -
poj 2096 概率dp详解
Collecting Bugs Time Limit: 10000msMemory Limit: 64000KB This problem will be judged on PKU. Original ID: 2096 64-bit integer IO format: %lld Java class name: Main Special Judge Prev Submit St原创 2017-05-30 12:48:58 · 431 阅读 · 0 评论 -
A - 任务的分配 HIT - 1939
哈尔滨工业大学计算机专业创建于1956年,是中国最早建立的两个计算机专业之一。哈工大计算机专业目前拥有雄厚的师资,其科研能力在全国处于领先地位。最近,工大经常接到一些大型的计算机科研项目。这些项目的运算量十分巨大,工大现有的计算机已经不能满足要求了。因此,工大最近购进了一台十分先进的巨型计算机。这个计算机有许多CPU,每个CPU都能单独地处理一个任务。这个计算机的工作原理是:接到一批任务后,把每个任原创 2017-05-01 19:01:41 · 228 阅读 · 0 评论 -
what dp其实是dfs(深搜)的简版
直接看代码,怎么运行的还是搞不懂, mmp,跑了好几遍,都没跑出程序的运行步骤,; 感觉智商好低,但是能敢说这就是01的函数形式;#include<iostream>#include<cstdio>#include<cmath>#include<cstring>#include<string>#include<algorithm>#include<stack>#include<qu原创 2017-04-28 15:28:39 · 545 阅读 · 0 评论 -
zoj_3822_概率dp入门
Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What’s more, he bought a large decorative chessboard with N rows and M columns.Ever原创 2017-12-03 00:40:48 · 250 阅读 · 0 评论