
dp
文章平均质量分 89
Z~柳
这个作者很懒,什么都没留下…
展开
-
Two Buildings(决策单调性+分治)
题意是求max((a[j]+a[i])∗(j−i)),1≤i<j<nmax({(a[j] + a[i]) * (j - i)}), 1 \le i <j<nmax((a[j]+a[i])∗(j−i)),1≤i<j<n可转化为求 max((a[j]−(−a[i]))∗(j−i))max({(a[j] - (-a[i])) * (j - i)})max((a[j]−(−a[i]))∗(j−i))令b[i]=−a[i]b[i] = - a[i]b[i]=−a[i]即变.原创 2021-03-30 22:03:58 · 306 阅读 · 0 评论 -
HDU1145 So you want to be a 2n-aire?(随机概率·概率dp·好题)
传送门题意很简单:问答游戏,初始金额有一块钱,如果选择答的话,答对奖金翻倍,答错就没钱了,如果不答的话就,就维持奖金。答对的概率是[t,1][t,1][t,1]的一个随机概率。问在最优的策略下,nnn局后能获得的最大奖金期望值。我们先来简化一下题目。把概率固定为一个值ppp设dp[i]dp[i]dp[i]为在n−in-in−i题后能获得的可能最大奖金。则dp[n]=1<<nd...原创 2020-02-17 17:20:42 · 411 阅读 · 0 评论 -
SOSdp--1208F Bits And Pieces
SOSdp学于cf的一篇博客SOSDP以下是对他的一些理解:如cf博客中 引入一个问题:求F[x]=∑i∈xA[i]\sum\limits_{i∈x}A[i]i∈x∑A[i]这里的i满足iii&x=iii ,即iii是xxx的子集。如F[1012101_21012]=A[1012101_21012]+A[1002100_21002]+A[0012001_20012]+A[0...原创 2020-01-14 00:24:04 · 227 阅读 · 0 评论 -
hdu3652(数位dp)
A wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string “13” and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 143 and 2639 ar...原创 2019-05-22 22:04:22 · 314 阅读 · 0 评论 -
hdu1069 测猴子智力(改成最大上升子序列)
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 monk...原创 2019-02-21 11:32:22 · 153 阅读 · 0 评论 -
hdu2380(dp,最大矩形面积)
Given an N * M matrix with each entry equal to 0 or 1. We can find some rectangles in the matrix whose entries are all 1, and we define the maximum area of such rectangle as this matrix’s goodness.We...原创 2019-02-24 12:53:26 · 243 阅读 · 0 评论 -
UVA11264 钱币兑换(dp+贪心+详解)
Our dear Sultan is visiting a country where there are n different types of coin. He wants to collectas many different types of coin as you can. Now if he wants to withdraw X amount of money from aBa...原创 2019-02-13 12:10:44 · 317 阅读 · 0 评论 -
hdu2571(棋盘翻转)
穿过幽谷意味着离大魔王lemon已经无限接近了!可谁能想到,yifenfei在斩杀了一些虾兵蟹将后,却再次面临命运大迷宫的考验,这是魔王lemon设下的又一个机关。要知道,不论何人,若在迷宫中被困1小时以上,则必死无疑!可怜的yifenfei为了去救MM,义无返顾地跳进了迷宫。让我们一起帮帮执着的他吧!命运大迷宫可以看成是一个两维的方格阵列,如下图所示:yifenfei一开始在左上角,目的...原创 2019-02-10 00:03:01 · 177 阅读 · 0 评论 -
HDU1505(最大完全子矩阵)
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees,factories and building...原创 2019-02-07 23:31:46 · 167 阅读 · 0 评论 -
hdu1176掉馅饼(dp)
都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中是个身手敏捷的高手,但在现实中运动神经特别迟钝...原创 2019-02-21 14:16:20 · 289 阅读 · 0 评论 -
hdu1442(世界杯)
世界杯结束了,意大利人连本带利的收回了法国人6年前欠他们的债,捧起了大力神杯,成就了4星意大利.世界杯虽然结束了,但是这界世界杯给我们还是留下许多值得回忆的东西.比如我们听到了黄名嘴的3分钟激情解说,我们懂得了原来可以向同一个人出示3张黄牌,我们还看到了齐达内的头不仅能顶球还能顶人…………介于有这么多的精彩,xhd决定重温德国世界杯,当然只是去各个承办世界杯比赛的城市走走看看.但是这需要一大比...原创 2019-01-28 20:57:27 · 146 阅读 · 0 评论