摘要: 1. BSGS 例题:P3846 【模板】BSGS / [TJOI2007] 可爱的质数 BSGS 的 oi wiki 介绍:链接 但是我感觉还是 chebs大佬的博客 更好理解。 示例程序: #include <bits/stdc++.h> using namespace std; using l 阅读全文
posted @ 2026-05-05 14:49 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 双倍经验 题目链接:https://www.luogu.com.cn/problem/P1495 解题思路:完全来自 oi wiki 注意:要开 __int128,不然会被 hack。 示例程序: #include <bits/stdc++.h> using namespace std; using 阅读全文
posted @ 2026-05-04 15:45 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P5169 暴力解法就是:线性基,然后对于每次询问的 \(x\),枚举 \((u,v)\) 对,跑一遍线性基就是否存在连接 \(u - v\) 的异或和为 \(x\) 的路径。时间复杂度 \(O(q \cdot n^2 \c 阅读全文
posted @ 2026-04-30 19:43 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/U682392 就是维护一个桶,对桶数组求 FWT 即可。 \(0\) 要特判。 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = (1 阅读全文
posted @ 2026-04-30 18:32 quanjun 阅读(5) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4717 解题思路完全来自 oi.wiki 补充理解: 在 或(or)运算 中, \[FWT[A]_i \cdot FWT[B]_i \]\[= \left( \sum_{i \cup j=i} A_j \right) \ 阅读全文
posted @ 2026-04-30 15:30 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://acm.hdu.edu.cn/showproblem.php?pid=3605 说明 hdu 的 G++ 编译器 比 C++ 编译器 慢,而这题比较卡时间,需要用 C++ 编译器。 但是 C++ 编译器不支持 万能头,所以你得手写 非万能头 的头文件,然后用 C++ 提交。 阅读全文
posted @ 2026-04-29 14:47 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P1559 模拟退火模板题。 实例程序: #include <bits/stdc++.h> using namespace std; int n, P[22][22], Q[22][22], p[22]; long long 阅读全文
posted @ 2026-04-29 13:35 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P4055 二分图博弈 先手必胜 的结论: \(\dagger\) 先手必胜当且仅当起点 \(u\) 在该二分图的所有最大匹配上。 解题思路:完全来自 hopeful_imitation大佬的博客 其核心结论(文字的最后一段 阅读全文
posted @ 2026-04-28 15:27 quanjun 阅读(4) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3967 解题思路: 完全来自 7KByte大佬的博客,特别是博客中的以下这句话: 但如果我们直接枚举每条边删除再跑费用流,并不能再规定时间内跑完。经过观察我们发现,跑第一问的费用流时,一共只有n条男生到女生的边有流量。所 阅读全文
posted @ 2026-04-27 20:32 quanjun 阅读(3) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3381 解题思路:完全来自 oi.wiki 代码对应我之前写的 最大流Dinic模板 + oi.wiki 上 基于dinic的修改。 示例程序: #include <bits/stdc++.h> using namesp 阅读全文
posted @ 2026-04-27 19:40 quanjun 阅读(3) 评论(0) 推荐(0)