
区间,概率dp
UCAS王小二
不念过去,不畏未来...
展开
-
LightOJ 1030 Discovering Gold【概率dp】
You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold. Initially you are in position 1. Now each turn you throw a perfect 6原创 2017-11-16 21:17:33 · 216 阅读 · 0 评论 -
POJ 1160 Post Office【区间DP+四边形不等式优化】
POJ 1160 Post Office题意:给你nnn个点,在这nnn个点中选择mmm个点建立基站,定义节点iii到基站jjj处的花费abs(j−i)abs(j - i)abs(j−i),让你求解最小花费.分析:我的暴力:预处理区间(L,R)(L,R)(L,R)建立一个基站的最小花费,dp[i][j]:表示前i个点建立j个基站的最小花费dp[i][j]:表示前i个点建立j个基站的最小花费d...原创 2018-10-19 22:06:09 · 226 阅读 · 0 评论 -
POJ 1651 Multiplication Puzzle【区间DP】
题目: POJ 1651 The multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move player takes one card out of the row and scores the number of poi...原创 2018-02-14 17:57:35 · 243 阅读 · 0 评论 -
POJ 2955 Brackets【区间DP】
Description We give the following inductive definition of a “regular brackets” sequence: the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) an...原创 2018-02-11 12:31:23 · 149 阅读 · 0 评论 -
LightOJ 1422 Halloween Costumes【区间DP】
题目:LightOJ 1422 Halloween Costumes Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it’s Halloween, t...原创 2018-02-13 23:01:48 · 294 阅读 · 0 评论 -
Light OJ 1025 The Specials Menu【区间DP】
题目:Light OJ 1025 The Specials Menu Feuzem is an unemployed computer scientist who spends his days working at odd-jobs. While on the job he always manages to find algorithmic problems within mund...原创 2018-02-12 17:28:20 · 218 阅读 · 0 评论 -
POJ 3186 Treats for the Cows【区间DP+思维】
POJ 3186. Description FJ has purchased N (1 <= N <= 2000) yummy treats for the cows who get money for giving vast amounts of milk. FJ sells one treat per day and wants to maximize the m...原创 2018-02-12 12:12:02 · 221 阅读 · 0 评论 -
NYOJ 746 整数划分(四)【区间DP || DFS】
NYOJ 746. 描述 暑假来了,hrdv 又要留学校在参加ACM集训了,集训的生活非常Happy(ps:你懂得),可是他最近遇到了一个难题,让他百思不得其解,他非常郁闷。。亲爱的你能帮帮他吗? 问题是我们经常见到的整数划分,给出两个整数 n , m ,要求在 n 中加入m - 1 个乘号,将n分成m段,求出这m段的最大乘积 输入 ...原创 2018-02-11 21:59:30 · 262 阅读 · 0 评论 -
NYOJ 737 石子合并(一)【区间DP】
NYOJ 737. 描述 有N堆石子排成一排,每堆石子有一定的数量。现要将N堆石子并成为一堆。合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆。求出总的代价最小值。 输入 有多组测试数据,输入到文件结束。 每组测试数据第一行有一个整数n,表示有n堆石子。 接下来的一行有n(0< n <...原创 2018-02-10 23:46:03 · 202 阅读 · 0 评论 -
HDU 3480 Division【区间DP+四边形不等式优化】
题意:将含有n个元素的一个集合分成m个子集,定义一个子集的价值为:最大值与最小值差的平方,求m个子集的最小和.记录:四边形不等式优化:还不是很懂这个。。。目前总结的话,遇到区间DP,先弄一个O(n3)O(n^3)O(n3),然后如果不可行,就直接放for(intk=s[i][j−1];k&amp;lt;=s[i+1][j];++k)for(int k = s[i][j - 1]; k &amp...原创 2018-10-17 11:31:55 · 272 阅读 · 0 评论