摘要: 题意:在 $n$ 个数的 $2^n-1$ 个非空子集中选取 $m$ 个,且必须满足: 1. $m$ 个子集两两不同. 2. 每个数在 $m$ 个子集中出现总次数为偶数. 3. 每个子集非空. 令 $f[i]$ 表示选出了 $i$ 个集合且满足了上述 3 条限制的方案数. 直接求 $f[i]$ 比较困 阅读全文
posted @ 2020-01-06 22:40 EM-LGH 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 这个题和那个城市规划几乎是一个套路. 就是钦定一个点,然后枚举这个点所在连通块大小,然后其余部分随便连. 由于我们钦定了一个点,所以我们算的方案数肯定不会重复. 即 $f[S]=TOT(S)-\sum_{T \subseteq S} f(T) \times TOT(S-T)$. code: #inc 阅读全文
posted @ 2020-01-06 16:42 EM-LGH 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题意: 给定一张图,和这个图的一颗生成树. 求:重新对这颗树标号,有多少种标号方式满足如果一条边 $(x,y)$ 在树中出现的话在图中也出现. 暴力做法:$f[i][j][S]$ 即在以 1 为根的树中遍历到点 $i$,该点映射的点是 $j$,且 $i$ 这颗子树映射的点集是 $S$. 转移的话时间 阅读全文
posted @ 2020-01-06 16:14 EM-LGH 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 这个还是非常神仙的... code: #include <cstdio> #include <algorithm> #define N 1006 #define ll long long #define setIO(s) freopen(s".in","r",stdin) using namespa 阅读全文
posted @ 2020-01-06 11:59 EM-LGH 阅读(117) 评论(0) 推荐(0) 编辑
摘要: code: #include <cstdio> #include <string> #include <cstring> #include <algorithm> #define N 66 #define ll long long #define mod 998244353 using namesp 阅读全文
posted @ 2020-01-06 10:23 EM-LGH 阅读(145) 评论(0) 推荐(0) 编辑
摘要: code: #include <cstdio> #include <cstring> #include <algorithm> #define ls x<<1 #define rs x<<1|1 #define N 2105 #define ll long long #define setIO(s) 阅读全文
posted @ 2020-01-06 08:47 EM-LGH 阅读(166) 评论(0) 推荐(0) 编辑