摘要: 题目链接:https://www.luogu.com.cn/problem/P6478 解题思路完全来自 GaryH大佬的博客 注意: 由于 \(f_{1, i}\) 表示钦定了 \(i\) 对,但是剩余的 \(\frac{n}{2} - i\) 对可以任意组合,所以 \(f_{1, i}\) 还得 阅读全文
posted @ 2026-04-09 21:44 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3803 更好的阅读体验 和 效率更高的实现 来自 自为风月马前卒 大佬 的博客 我的代码实现: 使用了 STL 提供的 complex (太懒了,所以没有自己实现 Complex) 使用的递归版本(非递归版本还有细节,暂 阅读全文
posted @ 2026-04-09 13:51 quanjun 阅读(2) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P10596 解题思路:完全来自 GhostLX大佬的学习笔记 示例程序: #include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 阅读全文
posted @ 2026-04-06 17:35 quanjun 阅读(1) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4859 给你两个长度为 \(n\) 的数列 \(a\) 和 \(b\),求数列 \(a\) 存在多少个排列满足: “\(a_i \gt b_i\) 的下标数量” \(-\) “\(a_i \lt b_i\) 的下标数量” 阅读全文
posted @ 2026-04-06 17:07 quanjun 阅读(1) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P1595 设 \(f_n\) 表示 恰好 装错 \(n\) 封信的方案数; \(g_n\) 表示 装错 \(\le n\) 封信的方案数。 则 \[g_n = \sum_{i=0}^n f_i \]根据 二项式反演 得 \ 阅读全文
posted @ 2026-04-06 14:51 quanjun 阅读(1) 评论(0) 推荐(0)
摘要: 题目链接:https://atcoder.jp/contests/abc451/tasks/abc451_g 首先,你需要解决 这道 “线性基” 的题:P14994 异或最短路和 其次,你需要会使用 01trie 实现以下功能: 插入一个数字; 判断入门有多少个数字 \(\oplus x \lt K 阅读全文
posted @ 2026-03-29 17:00 quanjun 阅读(26) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4719 解题思路:完全来自 oi.wiki 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5, inf = 1e9; 阅读全文
posted @ 2026-03-23 01:06 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://codeforces.com/problemset/problem/932/F 前置知识: 李超线段树 + 李超线段树合并,见 oi.wiki 本题解题思路: 在掌握前置知识后,其实你会发现这是一道模板题。但是也可以参考一下官方的题解。 示例程序: #include <bi 阅读全文
posted @ 2026-03-19 20:40 quanjun 阅读(4) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P5494 解题思路:来自 oi.wiki 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5, maxm = maxn 阅读全文
posted @ 2026-03-19 19:11 quanjun 阅读(5) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4556 解题思路:来自 oi.wiki 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5, M = 1e5; int 阅读全文
posted @ 2026-03-19 14:45 quanjun 阅读(4) 评论(0) 推荐(0)