
杜教筛
Gzb1128
保持你的决心
展开
-
[杜教筛]小结
你问我是参考哪里的,我只能回答无可奉告 http://blog.youkuaiyun.com/skywalkert/article/details/50500009 这篇博客如果和tangls的博客有雷同之处,并非偶然通常我们用艾拉筛,nlogn,通常跑很快。 但是随着oi的发展,我们用到了线性筛,On,跑的更快。 当你以为On筛能解决所有事情时,出题人已经开始使用O(n23)O(n23)O(n^...原创 2017-03-16 20:49:06 · 661 阅读 · 1 评论 -
[51nod][数论][积性函数]欧拉函数之和
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1239sol:简单杜教筛#include<iostream>#include<string>#include<cstring>#include<algorithm>#include<cstdi...原创 2018-03-19 19:28:51 · 566 阅读 · 0 评论 -
[51nod][积性函数]莫比乌斯函数之和
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1244sol:简单杜教筛#include<iostream>#include<string>#include<cstring>#include<algorithm>#include<cstdio&...原创 2018-03-19 19:29:50 · 216 阅读 · 0 评论 -
[hdu5608][积性函数]function
http://acm.hdu.edu.cn/showproblem.php?pid=5608sol:简单杜教筛 设g(n)=n^2-3n+2,s(n)=∑nif(i)∑inf(i)\sum_i^n f(i) g=f∗1g=f∗1g=f*1 g∗μ=f∗1∗μ=f∗eg∗μ=f∗1∗μ=f∗eg*\mu=f*1*\mu=f*e f(n)=∑d|ng(d)μ(nd)∑d|ng(d)μ(...原创 2018-03-19 20:03:37 · 240 阅读 · 0 评论 -
[51nod][积性函数][杜教筛]最小公倍数之和 V3
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1238sol:https://www.cnblogs.com/Blue233333/p/8320009.html 比较套路就不推了(虽然我做了2天) 具体可以见我杜教筛小结的那个博客,套路题 就是化到求i^2phi(i)的前缀和的时候卷一下id^2,就是个很好...原创 2018-03-22 10:05:01 · 177 阅读 · 0 评论 -
[51nod][积性函数][杜教筛]最大公约数之和 V3
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1237sol:本来已经不想做裸题了,但是之前的题总是要调一下才能过,就很不优美 这题终于一遍过了,感觉差不多把调试的坑点给找完了。杜教筛的精髓似乎也掌握到一点了。 简单反演∑ndd∑ndi∑ndj(i,j)=1∑dnd∑ind∑jnd(i,j)=1\su...原创 2018-03-22 11:23:28 · 268 阅读 · 0 评论