摘要: 树形DP#include #include #include #include using namespace std; int indg[152],n,p,cnt,f[152][152],head[152],nex[302],to[302]; void inline read(int &x){ char ch=getchar();x=0; while(!isdigit(ch)... 阅读全文
posted @ 2018-05-09 20:36 lnyzo 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 我们可以构造形如以下的一个矩阵 x 3x 9x 27x... 2x 6x 18x 54x 4x 12x 36x 108x 8x 24x 72x 216x 就是这种形式 那我们先令x=1吧,构造之: 1 3 9 27... 2 6 18 54... 4 12 36 108... 8 24 72 216 阅读全文
posted @ 2018-05-09 15:59 lnyzo 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 树链剖分裸题 唯一一个要注意的地方就是数据范围吧。计算时不写(long long)是会爆掉的 阅读全文
posted @ 2018-05-09 14:52 lnyzo 阅读(110) 评论(0) 推荐(0) 编辑