上一页 1 2 3 4 5 6 7 8 9 10 ··· 73 下一页
摘要: 题目: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 阅读(318) 评论(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) 编辑
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4336 bzoj 4036 的简单版,Min-Max 容斥即可。 代码如下: 阅读全文
posted @ 2019-01-15 20:44 Zinn 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2839 设 \( f(i) \) 为至少 \( i \) 个选择,则 \( f(i) = C_{n}^{i} * (2^{2^{n-i}} - 1) \),因为其他可选可不选; 设 \( g(i 阅读全文
posted @ 2019-01-15 20:11 Zinn 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 题目:http://codeforces.com/gym/101933/problem/K 其实每个点的颜色只要和父亲不一样即可; 所以至多 i 种颜色就是 \( i * (i-1)^{n-1} \),设为 \( f(i) \),设恰好 i 种颜色为 \( g(i) \) 那么 \( f(i) = 阅读全文
posted @ 2019-01-15 18:34 Zinn 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uoj.ac/problem/54 10分还要用 Lucas 定理囧...因为模数太小了不能直接算... #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef lon 阅读全文
posted @ 2019-01-15 17:39 Zinn 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 题目:http://uoj.ac/problem/55 https://www.luogu.org/problemnew/show/P3920 参考博客:https://www.cnblogs.com/Khada-Jhin/p/10078584.html 于是写了替罪羊树,但无论怎么调参都会T,UO 阅读全文
posted @ 2019-01-14 22:21 Zinn 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4036 min-max容斥:https://blog.csdn.net/ez_2016gdgzoi471/article/details/81416333 二项式反演:https://blog. 阅读全文
posted @ 2019-01-12 16:19 Zinn 阅读(242) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 73 下一页