随笔分类 -  动态规划——普通DP

摘要:"ref" 我是傻逼,我啥也不会,这是我抄的。 cpp include include include using namespace std; int n, a, b, w[55], tot, dy[1005], g[55][55], f[55][55][55][55], va[55]; bool 阅读全文
posted @ 2018-05-22 20:24 poorpool 阅读(354) 评论(0) 推荐(0)
摘要:pkusc 快到了……做点题涨涨 rp。 "ref" 我好菜啊QAQ。 可以发现期望只是一个幌子。我们的目的是:对于所有随机的选择方法(一共 $\binom{2n}{m}$种),这些选择方法都最优地打出 $k$ 张牌,他们能造成的伤害的和是多少。 显然的是,能打强化就打强化(不过你好歹也要攻击一张) 阅读全文
posted @ 2018-05-21 08:43 poorpool 阅读(1145) 评论(2) 推荐(0)
摘要:"problem" cpp include include include using namespace std; typedef long long ll; int n, a[2005]; ll dp[2005][2005]; int main(){ cin n; for(int i=1; i 阅读全文
posted @ 2018-05-06 17:12 poorpool 阅读(168) 评论(0) 推荐(0)
摘要:"ref" cpp include include include include using namespace std; typedef long long ll; int n, m, a[2005], b[2005]; ll dp[2005][2005]; ll f(){ memset(dp, 阅读全文
posted @ 2018-04-22 20:42 poorpool 阅读(120) 评论(0) 推荐(0)
摘要:"there" 阅读全文
posted @ 2018-04-13 19:48 poorpool 阅读(247) 评论(0) 推荐(0)
摘要:巨水,调了好久,心态爆炸 cpp include include include using namespace std; typedef long long ll; int n, m; const int mod=9999973; ll dp[105][105][105]; inline int 阅读全文
posted @ 2018-01-12 21:41 poorpool 阅读(132) 评论(0) 推荐(0)
摘要:dp[i]表示第一队打饭时间i的最优解 cpp include include include include using namespace std; struct Node{ int aa, bb; }nd[205]; int n, sum[205], dp[40005], ans=0x3f3f 阅读全文
posted @ 2017-12-20 09:39 poorpool 阅读(113) 评论(0) 推荐(0)
摘要:先排个序然后做最长上升子序列就行了。 cpp include include include using namespace std; struct Node{ int ll, ww; }nd[50005]; int n, cnt, dp[5005]; bool cmp(Node x, Node y 阅读全文
posted @ 2017-12-18 18:57 poorpool 阅读(179) 评论(0) 推荐(0)
摘要:倒着推就是了 cpp include include include using namespace std; int n, k, p, t, dp[10005]; vector a[10005];//是他,就是他!我们的英雄vector! int main(){ cin n k; for(int 阅读全文
posted @ 2017-12-18 11:10 poorpool 阅读(113) 评论(0) 推荐(0)