上一页 1 2 3 4 5 6 7 8 9 ··· 66 下一页
摘要: 题目链接:https://www.luogu.com.cn/problem/P3911 题目大意: 给你一个长度为 \(N\) 的数列 \(A_1, A_2, \ldots, A_N\),求 \[\sum_{i=1}^N \sum_{j=1}^N \operatorname{lcm}(A_i, A_ 阅读全文
posted @ 2026-05-13 09:22 quanjun 阅读(24) 评论(0) 推荐(0)
摘要: 莫比乌斯函数 \(\mu(n)\) 这是反演的核心工具,它的定义如下: \(\mu(1) = 1\) \(\mu(n) = (-1)^k\):如果 \(n\) 是 \(k\) 个互不相同的质数的乘积。 \(\mu(n) = 0\):如果 \(n\) 含有平方因子(即某个质因子的平方能整除 \(n\) 阅读全文
posted @ 2026-05-12 15:21 quanjun 阅读(28) 评论(0) 推荐(0)
摘要: 欧拉函数(Euler's totient function),通常用希腊字母 \(\varphi(n)\) 表示,是数论中一个非常重要的函数。 核心定义 对于正整数 \(n\),欧拉函数 \(\varphi(n)\) 是指:在小于或等于 \(n\) 的正整数中,与 \(n\) 互质(最大公约数为 1 阅读全文
posted @ 2026-05-11 18:03 quanjun 阅读(98) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P11175 解题思路完全来自 oi.wiki 示例程序: #include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 5; int fadd(i 阅读全文
posted @ 2026-05-10 10:16 quanjun 阅读(26) 评论(0) 推荐(0)
摘要: 题目链接:https://loj.ac/p/143 解题思路:完全来自 oi.wiki 时间复杂度:\(O(k \log^3 n)\)。 Miller–Rabin 素性测试 的结论 对于一个奇数 \(n\),将 \(n - 1\) 表示为 \[n - 1 = 2^s \cdot d \]其中,\(d 阅读全文
posted @ 2026-05-08 18:06 quanjun 阅读(21) 评论(0) 推荐(0)
摘要: 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 阅读(20) 评论(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 阅读(30) 评论(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 阅读(24) 评论(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 阅读(14) 评论(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 阅读(15) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 66 下一页