随笔分类 -  动态规划-玄学DP

摘要:题面:https://www.luogu.org/problem/P1280 阅读全文
posted @ 2019-09-30 20:39 prestige 阅读(194) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problem/P2679 阅读全文
posted @ 2019-09-30 06:44 prestige 阅读(101) 评论(0) 推荐(0)
摘要:```cpp 【题目描述】: ZL王国有一条母亲河,沿河有N个农庄,ZL王国的农产品都是出产自这N个农庄。为了抵制黑心的农贩子,这次ZL国王决定由王国统一收购,并给出了让农户非常满意的价格,甚至国王还下旨运输路费王国报销。这N个农庄主非常高兴,决定满载货船赶往收购点。 可是王国的国库空虚,勉强够收购 阅读全文
posted @ 2019-09-24 13:20 prestige 阅读(150) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problem/P2577 cpp 本题一旦设出f[i][j]表示前i个人,在1号窗口打饭总时间j,最早吃完饭的时间 那么就很容易想到 当把i放在1号窗口 f[i][j] = min(f[i][j], max(f[i 1][j s[i].a], j+ 阅读全文
posted @ 2019-09-22 13:34 prestige 阅读(121) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problem/P1541 cpp 本题由于每种牌个数 include include include include include include include using namespace std; const int N=355,M=45 阅读全文
posted @ 2019-09-06 01:17 prestige 阅读(98) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P3431 cpp Code: include include include include include include include using namespace std; const int N=1000 阅读全文
posted @ 2019-07-18 13:45 prestige 阅读(90) 评论(0) 推荐(0)
摘要:```cpp 题目背景 Generic Cow Protests, 2011 Feb 题目描述 约翰家的N 头奶牛正在排队游行抗议。一些奶牛情绪激动,约翰测算下来,排在第i 位的奶牛的理智度为Ai,数字可正可负。 约翰希望奶牛在抗议时保持理性,为此,他打算将这条队伍分割成几个小组,每个抗议小组的理智 阅读全文
posted @ 2019-07-18 13:45 prestige 阅读(136) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P2782 阅读全文
posted @ 2019-07-16 13:48 prestige 阅读(176) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P1108 阅读全文
posted @ 2019-07-16 13:48 prestige 阅读(220) 评论(0) 推荐(0)
摘要:题面:https://www.luogu.org/problemnew/show/P1052 cpp dp方程很好推:f[i]=min(f[i],f[i j])+stone[i]; 但是要离散化,即将中间的距离mod 2520(1~10的最小公倍数) Code: include include us 阅读全文
posted @ 2019-07-16 13:46 prestige 阅读(91) 评论(0) 推荐(0)