摘要: f[i][j]表示到第i位,使用了j次机会的最长不下降子序列长度转移:f[i][j]=max(f[x][y])+1;x#include#includeusing namespace std;int n,m,k;int a[10005],c[505][5505],f[1... 阅读全文
posted @ 2017-07-14 21:41 Ren_Ivan 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 首先明确:树上任意一点的最长路径一定是直径的某一端点。所以先找出直径,求出最长路径,然后再求波动值#include#include#include#include#include#include#define N 1000005using namespace std;... 阅读全文
posted @ 2017-07-14 21:35 Ren_Ivan 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 发现自己只会打状压了。 233333不需要考虑是否会被挡,所以直接dp#include#include#include#include#includeusing namespace std;int tot1,tot2,a[5][5],b[5][5];int x1[20... 阅读全文
posted @ 2017-07-14 21:32 Ren_Ivan 阅读(121) 评论(0) 推荐(0) 编辑