百题斩计划 4 / 虫需云力,白勺虫且

· · 闲话

神秘小标题。upd on 26/10/6 21:29 怎么 100 年没更新了。。。

https://www.luogu.com.cn/problem/P4383 树形 dp。f_{u ,0/1/2} 表示到了点 u,没选/挂起/闭合的含代价最佳值。上 wqs。

https://www.luogu.com.cn/problem/P15916 有题解。

https://www.luogu.com.cn/problem/P15234 分讨 dp 然后分段矩快转移即可。

https://www.luogu.com.cn/problem/P6569 异或矩阵快速幂。

https://www.luogu.com.cn/problem/P12046 先有基于前缀连通性的暴力 dp,然后使用 x1w 老师讲述的代值法,解方程化简递推式。

https://www.luogu.com.cn/problem/P9510 数形结合推式子。

https://www.luogu.com.cn/problem/solution/AT_abc478_g 是不是写了题解。

https://www.luogu.com.cn/problem/P17595 二分着 q,q 出来 0,用 0 再二分 q 出 1,以此类推。

https://www.luogu.com.cn/problem/P17611 n 小,于是枚举 x 的低位,其余部分正常一元一次方程即可。

https://www.luogu.com.cn/problem/P17612 做一次出 1 一定是充分的。不然会损失最高阈值。于是随便做。

https://www.luogu.com.cn/problem/P17615 有啥好说的,直接打表规律一下。。。发现有一堆质数平方,筛筛筛。发现有一堆 p (2p + 1),筛筛筛。剩一个 6,猜一下这个直接输出。于是对了。。。

https://www.luogu.com.cn/problem/P17624 标准二项式反演,枚举钦定几个作为叶,然后反演恰好,后缀和求至少即可。然后这样时间会炸,后缀和又有很多组有公因式的项,考虑交换求和顺序。最终要快速算固定上指标的组合数奇加偶减后缀和,图形法或数学归纳法解决即可。

http://10.10.255.150/p/P9020 简单题,求源汇点单源最短路及方案,来边过后分讨计算即可。

http://10.10.255.150/p/P9017 二分长度,然后使用滑动窗口 + 猫儿笑 check。

http://10.10.255.150/p/P7006 写了题解。

http://10.10.255.150/p/P9019 未能绷住的模拟,实现时注意截断过后还要输入但是不更新 lst。

http://10.10.255.150/p/P9012 应该是黑的。点分治,先分 k = 1 和其余分别讨。然后做法是大同小异的,dfs 记录状态然后塞到一个有序表里面最后统计。

https://www.luogu.com.cn/problem/P8392 神秘题目,先全选,然后踢出明显不合适的,最后背包 dp 微调。

https://www.luogu.com.cn/problem/P9210 层序遍历完过后倒起做。

https://www.luogu.com.cn/problem/P14016 f_{i,j} 表示不考虑 i 的子树,i 前有 j 个的方案数。然后随便 dp 转移一下,最后统计的时候把子树并过去就可以了。