上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 84 下一页

2019年1月15日

最值反演学习笔记

摘要: 关于用一个集合的子集的 min 求这个集合的 max 的问题。当然用 max 求 min 也可以。 考虑构造一个只和集合元素个数有关的 \( f( \left | S \right | ) \) ,使得可以 \( kthmax(S)=\sum\limits_{T \subseteq S} f( \l 阅读全文

posted @ 2019-01-15 22:00 Narh 阅读(498) 评论(0) 推荐(1) 编辑

hdu 4336 Card Collector——最值反演

摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=4336 点集中最早出现的元素的期望是 min ,最晚出现的元素的期望是 max ;全部出现的期望就是最晚出现的元素的期望。 阅读全文

posted @ 2019-01-15 21:11 Narh 阅读(148) 评论(0) 推荐(0) 编辑

bzoj 2839 集合计数——二项式反演

摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2839 设 \( g(i) \) 表示至少有 i 个, \( f(i) \) 表示恰好有 i 个,则 \( g(i)=C_{n}^{i}*(2^{2^{n-i}}-1) \) \( g(i)=\ 阅读全文

posted @ 2019-01-15 20:35 Narh 阅读(250) 评论(0) 推荐(0) 编辑

CF gym101933 K King's Colors——二项式反演

摘要: 题目:http://codeforces.com/gym/101933/problem/K 每个点只要和父亲不同色就行。所以 “至多 i 种颜色” 的方案数就是 i * ( i-1 )n-1 。 阅读全文

posted @ 2019-01-15 19:49 Narh 阅读(262) 评论(0) 推荐(0) 编辑

UOJ 54 【WC2014】时空穿梭——莫比乌斯反演

摘要: 题目:http://uoj.ac/problem/54 想写20分。 Subtask 2 就是枚举4个维度的值的比例,可算对于一个比例有多少个值可以选,然后就是组合数。结果好像不对。 因为模数太小,组合数不能用阶乘的那个公式。不过 c*m 递推即可。 #include<cstdio> #includ 阅读全文

posted @ 2019-01-15 18:40 Narh 阅读(315) 评论(0) 推荐(0) 编辑

2019年1月14日

UOJ 55 【WC2014】紫荆花之恋——点分治+平衡树

摘要: 题目:http://uoj.ac/problem/55 点分治。在点分树上每个点上用 splay 维护管辖的点的情况。做几次就重构点分树。TLE。只能过 20 分。 #include<cstdio> #include<cstring> #include<algorithm> #define ll l 阅读全文

posted @ 2019-01-14 14:33 Narh 阅读(164) 评论(0) 推荐(0) 编辑

2019年1月12日

bzoj 4036 [HAOI2015]按位或——min-max容斥+FMT

摘要: 题目:https://www.lydsy.com/JudgeOnline/problem.php?id=4036 题解:https://www.cnblogs.com/Zinn/p/10260126.html 阅读全文

posted @ 2019-01-12 16:47 Narh 阅读(264) 评论(0) 推荐(0) 编辑

CF 914G Sum the Fibonacci——子集卷积

摘要: 题目:http://codeforces.com/contest/914/problem/G 第一个括号可以子集卷积;第三个括号可以用 FWT 异或卷积;这样算出选两个数组成 x 的方案数;三个部分的方案数分别乘上 f[ x ] 再一起与卷积即可。 注意子集卷积的时候不要改 tp[ i ][ s ] 阅读全文

posted @ 2019-01-12 15:18 Narh 阅读(399) 评论(0) 推荐(0) 编辑

UOJ 348 【WC2018】州区划分——子集卷积

摘要: 题目:http://uoj.ac/problem/348 参考:https://www.cnblogs.com/NaVi-Awson/p/9242645.html#%E5%AD%90%E9%9B%86%E5%8D%B7%E7%A7%AF FMT就是快速莫比乌斯变换/反演,解决或卷积的问题,和 FWT 阅读全文

posted @ 2019-01-12 10:23 Narh 阅读(269) 评论(0) 推荐(0) 编辑

2019年1月11日

UOJ 347(洛谷4220) 【WC2018】通道——随机化

摘要: 题目:http://uoj.ac/problem/347 https://www.luogu.org/problemnew/show/P4220 先写了暴力分的44分。那个两棵树、其中一棵是编号连续的链、边权都是1的点好像可以线段树合并,但没写。 #include<cstdio> #include< 阅读全文

posted @ 2019-01-11 19:30 Narh 阅读(287) 评论(0) 推荐(0) 编辑

上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 84 下一页

导航