![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
「已注销」
这个作者很懒,什么都没留下…
展开
-
LOOPS-HDU 3853 (DP&&期望)
题意:一个R*C的布局,每个格子中给出停留在原地,往右走一个,往下走一格的概率,起点在(1,1),终点在(R,C),每走一格消耗2的能量,求出最后所需要的能量期望。思路:dp[i][j]记录从i,j出发到终点的期望,p[i][j][k]记录每格三种状况的概率。1、dp[ i ][ j ] ---> dp[ i ][ j ],转移概率为p1;2、dp[ i ][ j ] ---> ...原创 2020-03-29 13:19:17 · 261 阅读 · 0 评论 -
Aeroplane chess(DP&&期望)
题意:走棋游戏,投掷1-6的骰子,投到x,就从这个格子向前走x步。到达的格子有飞机就继续向前飞,当到达>=n的格子,游戏结束,问到游戏结束时的数学期望。思路:从后往前推。dp[i]代表的是刀哥i格时还需要投的次数。dp[n]=0;从n-1开始,到达一个格子k分两种情况:1、有飞机dp[k]=dp[f[k]];2、没有飞机,就累加从这个格子之后的6个格子的期望*(1/6),然后还有加上...原创 2020-03-29 13:17:18 · 496 阅读 · 0 评论 -
Collecting Bugs (DP&&期望)
题意:一个软件有s个子系统,会产生n种bug,某个人一天发现一个bug,这个bug属于某种bug,发生在某个子系统里。求找到所有的n种bug和s个子系统所需的天数的数学期望。(程序中的bug数量几乎是无限的,因此在某个子系统中发现某个类别的新bug的概率在发现该子系统中的任何类别的bug之后不会减少,所以发现一个bug是某种bug的概率是1/n,属于某个子系统的概率是1/s)。思路:dp[i]...原创 2020-03-29 13:15:41 · 218 阅读 · 0 评论 -
HDU-1494 跑跑卡丁车
跑跑卡丁车是时下一款流行的网络休闲游戏,你可以在这虚拟的世界里体验驾驶的乐趣。这款游戏的特别之处是你可以通过漂移来获得一种加速卡,用这种加速卡可以在有限的时间里提高你的速度。为了使问题简单化,我们假设一个赛道分为L段,并且给你通过每段赛道的普通耗时Ai和用加速卡的耗时Bi。加速卡的获得机制是:普通行驶的情况下,每通过1段赛道,可以获得20%的能量(N2O).能量集满后获得一个加速卡(同时能量清...原创 2019-07-28 10:49:12 · 193 阅读 · 0 评论 -
HDU-1160 FatMouse's Speed
FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequence...原创 2019-07-28 10:44:24 · 155 阅读 · 0 评论 -
HDU-1024 Max Sum Plus Plus
Now I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more difficult problem.Given...原创 2019-07-28 10:32:26 · 88 阅读 · 0 评论 -
HDU-1506 Largest Rectangle in a Histogram
A histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For example, the figure on the left shows ...原创 2019-07-28 10:16:16 · 93 阅读 · 0 评论 -
POJ-1631 Bridging signals
'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecting the ports ...原创 2019-07-22 20:34:39 · 113 阅读 · 0 评论 -
POJ - 1836 Alignment
In the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with the way his sold...原创 2019-07-22 20:27:31 · 72 阅读 · 0 评论 -
POJ-1260 Pearls
In Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl has its name because it delivers to the royal family of Pear...原创 2019-07-22 20:11:18 · 104 阅读 · 0 评论 -
POJ - 1976 A Mini Locomotive
A train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads decided to distribut...原创 2019-07-27 21:39:50 · 142 阅读 · 0 评论 -
POJ - 3181 Dollar Dayz
Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer John has exac...原创 2019-07-27 21:39:57 · 93 阅读 · 0 评论 -
HDU - 1503 Advanced Fruits
The company "21st Century Fruits" has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn't work, but sometime...原创 2019-07-27 21:40:03 · 250 阅读 · 0 评论 -
HDU - 2159 FATE
最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?Inp...原创 2019-07-27 21:40:10 · 123 阅读 · 0 评论 -
HDU - 1421 搬寝室
搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2*k件过去就行了.但还是会很累,因为2*k也不小是一个不大于n的整数.幸运的是xhd根据多年的搬东西的经验发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比(这里补充...原创 2019-07-25 21:21:52 · 84 阅读 · 0 评论 -
POJ-1159 Palindrome
最长公共子序列:https://www.cnblogs.com/wkfvawl/p/9362287.htmlA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a pr...原创 2019-07-22 19:47:47 · 106 阅读 · 0 评论 -
POJ - 3280 Cheapest Palindrome
对最长公共子序列的理解:https://blog.csdn.net/weixin_40673608/article/details/84262695Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on...原创 2019-07-29 21:08:50 · 140 阅读 · 0 评论