随笔分类 - 线性基
摘要:洛谷传送门 AtCoder 传送门 不妨考虑最后的结果可以成为哪些 \(a_i\) 的组合。为了方便分析,我们令 \(a_i = 2^{i - 1}\)。 进行一次操作后,所有 \(\text{popcount}(a_i)\) 都为偶数。所以一个 \(x \in [0, 2^n - 1]\) 能被生
阅读全文
摘要:洛谷传送门 CF 传送门 如果我们能把 \(x \to y\) 路径上的所有点权插入到线性基,那么可以 \(O(\log V)\) 查询。 但是因为线性基合并只能 \(O(\log^2 V)\)(把一个线性基的所有元素插入到另一个),所以只能倍增做 \(O((n + q) \log n \log^2
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc249_g "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc249/tasks/abc249_g "AtCoder 传送门") 好题。 套路地,考
阅读全文
摘要:[洛谷传送门](https://www.luogu.com.cn/problem/AT_abc223_h "洛谷传送门") [AtCoder 传送门](https://atcoder.jp/contests/abc223/tasks/abc223_h "AtCoder 传送门") 考虑一个无脑做法:
阅读全文

浙公网安备 33010602011771号