随笔分类 -  FWT

摘要:洛谷传送门 CF 传送门 UNR #2 黎明前的巧克力。 枚举两个人选的卡的并集 \(S\),那么当 \(\bigoplus\limits_{i \in S} a_i = 0\) 时 \(S\) 有贡献 \(2^{|S|}\)。 考虑将 \(2^{|S|}\) 分摊到每个元素上,也就是每个元素有 \ 阅读全文
posted @ 2023-12-25 18:39 zltzlt 阅读(46) 评论(0) 推荐(0)
摘要:QOJ 传送门 考虑从低位向高位 dp,设 \(f_{i, S}\) 为考虑到从低到高第 \(i\) 位,当前每个数超出上界的情况为 \(S\)。 转移可以枚举这一位填的数: 若 \(a_j = 0, r_j = 1\),那么这一位一定不会超出上界; 若 \(a_j = 1, r_j = 0\),那 阅读全文
posted @ 2023-09-25 11:37 zltzlt 阅读(60) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc220_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc220/tasks/abc220_h "AtCoder 传送门") 看到数据范围猜复杂 阅读全文
posted @ 2023-06-18 19:58 zltzlt 阅读(18) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc215_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc215/tasks/abc215_h "AtCoder 传送门") 考虑第一问。 发现 阅读全文
posted @ 2023-06-14 13:31 zltzlt 阅读(29) 评论(0) 推荐(0)
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_arc132_f "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/arc132/tasks/arc132_f "AtCoder 传送门") 没见过这种在新运算 阅读全文
posted @ 2023-05-24 12:50 zltzlt 阅读(31) 评论(0) 推荐(0)
摘要:洛谷传送门 AtCoder 传送门 牛逼题…… 考虑如果定义 $x^a \times x^b = x^{a \oplus b}$,设 $f(x) = \sum\limits_{i=1}^k x^{a_i}$,那么题目就是求,$\forall w > 0, \sum\limits_{i=1}^n (f 阅读全文
posted @ 2023-05-18 13:14 zltzlt 阅读(30) 评论(0) 推荐(0)
摘要:### 公式 普通 min-max 容斥: $$\max\limits_{i \in S} a_i = \sum\limits_{T \subseteq S \and T \ne \varnothing} (-1)^{|T|-1} \min\limits_{j \in T} a_j$$ $$\min 阅读全文
posted @ 2022-11-16 11:31 zltzlt 阅读(338) 评论(0) 推荐(0)