
动态规划
淼润淽涵
这个作者很懒,什么都没留下…
展开
-
洛谷--------P1002 过河卒
题目描述棋盘上AAA点有一个过河卒,需要走到目标BBB点。卒行走的规则:可以向下、或者向右。同时在棋盘上CCC点有一个对方的马,该马所在的点和所有跳跃一步可达的点称为对方马的控制点。因此称之为“马拦过河卒”。棋盘用坐标表示,AAA点(0,0)(0, 0)(0,0)、BBB点(n,m)(n, m)(n,m)(nnn, mmm为不超过202020的整数),同样马的位置坐标是需要给出的。现...原创 2019-05-25 11:45:34 · 170 阅读 · 0 评论 -
POJ 2533 最长上升子序列(dp)
Problem DescriptionA numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence ( a1, a2, ..., aN) be any sequence ( ai1, ai2, ..., aiK), wh...原创 2019-04-14 13:48:42 · 204 阅读 · 0 评论 -
HDU 1260 Tickets(DP)
Problem DescriptionJesus, 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 could he go...原创 2019-04-07 15:13:13 · 182 阅读 · 0 评论 -
HDU 2571 命运(dp)
Problem Description穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的方格阵列,如下图...原创 2019-04-01 22:25:54 · 152 阅读 · 0 评论 -
POJ 1316 Milking Time(dp)
Problem DescriptionBessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,000) hours (conveniently label...原创 2019-04-05 10:02:27 · 148 阅读 · 0 评论 -
HDU 1176免费馅饼
Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是...原创 2019-04-02 20:36:36 · 204 阅读 · 0 评论 -
动态规划之数塔问题
题意:下图是一个数塔,从顶部出发在每一个节点可以选择向左或者向右走,一直走到底层,要求找出一条路径,使得路径上的数字之和最大.算法实现:I. 首先利用一个二维数组data存储数塔的原始数据,然后利用一个中间数组dp存储每一次决策过程中的结果。II. 初始化dp,将data的最后一层拷贝到dp中。dp[n][j] = data[n][j] (j = 1, 2, …, n) 其中...原创 2019-03-24 11:29:23 · 1906 阅读 · 0 评论 -
题解报告Robberies(概率dp)
Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often because they become too greedy. He has decided to...原创 2019-03-30 12:15:27 · 297 阅读 · 0 评论 -
HDU 1078 FatMouse and Cheese(dp&记忆化搜索)
Problem DescriptionFatMouse 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 &...原创 2019-04-14 23:07:13 · 166 阅读 · 0 评论 -
POJ 1088 滑雪 (记忆化搜索&DP)
DescriptionMichael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21...原创 2019-04-14 23:00:25 · 160 阅读 · 0 评论