摘要: 题目: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 阅读(279) 评论(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 阅读(305) 评论(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) 编辑