摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2784 其实转移是一棵树,从根到一个点表示一种能量圈状态,当能量值大于 T 是停止,也就是成为叶子; 点数大约是整数划分,据说是 1.2e6 左右,可以 dfs; 设 \( d[x] \) 是儿 阅读全文
posted @ 2019-01-16 23:28 Zinn 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 题目:https://loj.ac/problem/2542 因为走到所有点的期望就是所有点期望的最大值,所以先最值反演一下,问题变成从根走到一个点集任意一点就停止的期望值; 设 \( f[x] \),则 \( f[x] = \frac{f[fa]+1+\sum\limits_{v \in son} 阅读全文
posted @ 2019-01-16 21:58 Zinn 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 题目:http://poj.org/problem?id=2096 题目好长...意思就是每次出现 x 和 y,问期望几次 x 集齐 n 种,y 集齐 s 种; 所以设 f[i][j] 表示已经有几种,转移一下即可。 代码如下: #include<cstdio> #include<cstring> 阅读全文
posted @ 2019-01-16 18:16 Zinn 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:https://loj.ac/problem/6485 先把 \( a_{i mod 4} \) 处理掉,其实就是 \( \sum\limits_{i=0}^{3} a_{i} \sum\limits_{j=0}^{n} C_{n}^{j} * s^{j} * [4|(j-i)] \) 然后把 阅读全文
posted @ 2019-01-16 08:49 Zinn 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3328 单位根反演,主要用到了 \( [k|n] = \frac{1}{k} \sum\limits_{i=0}^{k-1} w_{k}^{in} \)推导见:https://www.cnblo 阅读全文
posted @ 2019-01-16 08:01 Zinn 阅读(174) 评论(0) 推荐(0) 编辑