Dp
2017
poj 3249 Test for Job (拓扑排序+dp)
http://poj.org/problem?id=3249
题意: # 给一个DAG,现要从一条入度为0的点到一个出度为0的点,问最大点权和。
codeforces 855 B. Marvolo Gaunt's Ring (前缀最大,dp)
题目链接
题意:给出n,p,q,r,以及n(1E5)个数,所有数的范围都是[-1E9,1E9],现在问p_a[i]+q_a[j]+r*a[k]的最大值,满足1<=i<=j<=k<=n
leetcode 152. Maximum Product Subarray (最大连续子序列乘积,dp)
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the largest product = 6.
leetocde 63. Unique Paths II
Follow up for “Unique Paths”:
Now consider if some obstacles are added to the grids. How many unique paths would there be?
An obstacle and empty space is marked as 1 and 0 respectively in the grid.
leetcode 64. Minimum Path Sum (二维dp)
Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.
Note: You can only move either down or right at any point in time.
BZOJ 2748: [HAOI2012]音量调节 (dp)
2748: [HAOI2012]音量调节 # Time Limit: 3 Sec Memory Limit: 128 MB Submit: 1814 Solved: 1148 [Submit][Status][Discuss]
BZOJ 1207: [HNOI2004]打鼹鼠 (LIS)
1207: [HNOI2004]打鼹鼠 # Time Limit: 10 Sec Memory Limit: 162 MB Submit: 2854 Solved: 1390 [Submit][Status][Discuss]
2016
(dp专题004)hdu 2955Robberies(01背包变形)
题目链接
题意: 给出n个银行 ,以及抢劫每个银行可以得到的价值和被抓的概率,不同银行之间被抓的概率是相互独立的,现在给出安全概率p,只有当概率从小于安全概率时才是安全的,问最多能抢劫多少价值。
(dp专题003)hdu 4055 Number String(dp)
题目链接
题意:给出n(n<=1E3)个字符,字符可能为’D’,‘I’,’?’,第i位对应的字符分别表示,第i位大于第i+1位,第i位小于第i+1位,或者不确定。
【dp专题002】hdu 4489 The King’s Ups and Downs (dp)
题目链接
题意:问长度为n的“波浪”型排列(即1..n每个数出现一次)有多少。波浪型的含义是,“高低高”或者“低高低”
codeforces 605 A. Sorting Railway Cars (dp)
题目链接
题意:给出一个n个数的排列,每次可以把一个数放到最前面或者最后面的位置,问至少要进行多少次操作才能使得数列升序。
hdu 5763 || 2016 multi #4 1001 Another Meaning (kmp+dp)
hdu 5763 题目链接
题意:给定两个字符串A和B,每个出现在A中的B(可以overlap)都有两种含义,问A串一共可能有多少种含义。
codeforces 429 B. Working out (dp)
cf429 b 题目链接 题意:
n*m个格子,每个格子有一个人value a[i][j]>0,连个人,一个从左上角到右下角,每次只能向下或者向右移动,一个从左下到右上,每次只能向上或者向右移动,现在要求两个人恰好相遇一次,相遇点的a不算数,问在满足这样的条件下使得两个人的a最大。。。(很坑的一点是。。这里相遇并不考虑时间。。就是说,不在同一时间都到达过某一格子,也认为相遇。所以我认为,题目含义更准确的说法是,路径只有一个交点)