随笔分类 - 区间dp
摘要:problemsolutioncodes//每行独立区间DP, 贪心反例->某行像这样,4 1 1 1 1 1 233 3 3//2^80数据, 所以记得高精.#include#include#include#include#includeusing namespac...
阅读全文
摘要:problem给定 n 颗环形串起来的珍珠,每个珍珠有头标记 hi 和尾标记 ti,按照任意顺序合并相邻珍珠 u, v,会带来 hu ∗ tu ∗ tv 的收益,并且会结合成新的珍珠 w,其中 hw = hu, tw = tv。保证相邻珍珠同侧标记相同。求最大收益。 ...
阅读全文
摘要:提交:http://codevs.cn/problem/1048/递推//f[i]:到i为止的LIS的长度。//f[i]=max{1,f[j]+1|j#includeusing namespace std;int n, a[510], f[510], ans;int ...
阅读全文