摘要: 数组越界那个RE+WA的姹紫嫣红的。。。 乘法原理求种类数,类似于没有上司的舞会。 阅读全文
posted @ 2019-07-26 20:52 邱涵的秘密基地 阅读(135) 评论(0) 推荐(0) 编辑
摘要: $$f[u][step] = \begin{cases} C[u] & step = 0 \\ (\sum{f[v][step 1]}) f[u][step 2] \cdot (deg[u] 1) & 1 \leq step include include include include defin 阅读全文
posted @ 2019-07-26 20:10 邱涵的秘密基地 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 有点权的重心,拆掉点dfs不就是了吗 cpp // include include include // include // include define R(a,b,c) for(register int a = (b); a = (c); a) define Max(a,b) ((a) (b) 阅读全文
posted @ 2019-07-26 19:19 邱涵的秘密基地 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 贪心就离根最大距离 阅读全文
posted @ 2019-07-26 18:25 邱涵的秘密基地 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 考场上打出来个$2^n n^2 \log (n)$,还文件错误RE了。。。 其实这不就是个变了一点点的树形背包,状态是节点$u$子树的$贡献$。 cpp // include include include // include // include define R(a,b,c) for(regi 阅读全文
posted @ 2019-07-26 17:05 邱涵的秘密基地 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 除法不能用于同余系,要辗转相除。注意不能加入柱子到矩阵。 阅读全文
posted @ 2019-07-26 16:14 邱涵的秘密基地 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 矩阵树定理裸题 阅读全文
posted @ 2019-07-26 14:38 邱涵的秘密基地 阅读(165) 评论(0) 推荐(0) 编辑
摘要: $tag$没开够$WA$了一发。。。 求出$dfs$序,然后按深度分类更新与查询。 阅读全文
posted @ 2019-07-26 10:19 邱涵的秘密基地 阅读(207) 评论(0) 推荐(0) 编辑