
min_25筛
ACM败犬
这个作者很懒,什么都没留下…
展开
-
洛谷 P5325【模板】Min_25筛
参考博客: https://www.mina.moe/archives/12287 https://www.luogu.org/blog/user54214/solution-p5325 代码: #include<bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int maxn = 1e6 + ...原创 2019-09-09 12:21:55 · 214 阅读 · 0 评论 -
loj 6053 简单的函数(min_25筛模板)
25筛模板题 使用min_25的三个条件: 1.f(x)f(x)f(x) 是积性函数 2.f(p)f(p)f(p) 是一个简单多项式,p是素数 3.f(px)f(p^x)f(px) 容易求得(指O(1)O(1)O(1)时间内求得),p是素数 min_25筛用来求一些积性函数的前缀和 ∑i=1nf(i)\sum_{i = 1}^nf(i)∑i=1nf(i) 其大致思想是:将答案拆成质数和合数部...原创 2019-09-09 21:59:02 · 253 阅读 · 0 评论 -
2019 徐州网络赛 H.function(min_25筛)
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e6 + 10; const int mod = 998244353; ll inv2 = (mod+1)/2; ll w[maxn],g1[maxn],g2[maxn],id1[maxn],id2[maxn];...原创 2019-09-11 18:40:21 · 306 阅读 · 0 评论 -
Uoj 188.Sanrd(min_25筛次大质因数之和)
题目大意:让你求∑i=1nf(i)\sum_{i = 1} ^ nf(i)∑i=1nf(i),f(i)f(i)f(i)为 iii 的次小质因数。 代码: #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e6 + 10; bool ispri[maxn]; in...原创 2019-09-13 11:23:52 · 317 阅读 · 0 评论 -
Loj #572. 「LibreOJ Round #11」Misaka Network 与求和(莫比乌斯反演 + 杜教筛 + min_25筛(递推版))
代码: #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 2e5 + 10; const ll mod = 1ll << 32; bool ispri[maxn]; ll pri[maxn], num, tot; ll pw[maxn]; ll g[...原创 2019-09-13 14:28:01 · 267 阅读 · 0 评论