![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论函数
stony_oi
oi弱鸡qaq
今天终于开博客啦
展开
-
bzoj2440【线性筛】
#include#include#include#include#includeusing namespace std;typedef long long LL;inline int read(){ int x=0;bool f=0;char c=getchar(); for (;c'9';c=getchar()) f=c=='-'?1:0; for (;c>='0'&&c<原创 2016-12-10 15:45:45 · 215 阅读 · 0 评论 -
bzoj2301
#include#include#include#include#includeusing namespace std;#define LL long long LL read(){ LL f=1,x=0; char ch=getchar(); for (;ch'9';ch=getchar()) f=ch=='-'?-1:1; for (;ch>原创 2016-12-10 16:10:41 · 187 阅读 · 0 评论 -
spoj GCDEX【线性筛】
设,由于这里f(n)是两个积性函数的卷积,它也是积性的,可以用线性筛预处理出来,而答案即为时间复杂度O(N+T)#include#include#include#include#includeusing namespace std;typedef long long LL;inline int read(){ int x=0;bool f=0;char c=g原创 2016-12-12 15:42:47 · 268 阅读 · 0 评论 -
bzoj2818【莫比乌斯函数】【线性筛】
#include#include#include#include#includeusing namespace std;typedef long long LL;inline int read(){ int x=0;bool f=0;char c=getchar(); for (;c'9';c=getchar()) f=c=='-'?1:0; for (;c>='0'&&c<原创 2016-12-08 19:36:55 · 268 阅读 · 0 评论 -
bzoj2154【莫比乌斯函数】【线性筛】
#include#include#include#include#includeusing namespace std;typedef long long LL;inline int read(){ int x=0;bool f=0;char c=getchar(); for (;c'9';c=getchar()) f=c=='-'?1:0; for (;c>='0'&&c<原创 2016-12-09 11:28:34 · 218 阅读 · 0 评论 -
bzoj3994【莫比乌斯函数】
最关键的是这个恒等式然后推式子就行了#include#include#include#include#includeusing namespace std;typedef long long LL;inline int read(){ int x=0;bool f=0;char c=getchar(); for (;c'9';c=getchar()) f=c==原创 2016-12-17 11:19:32 · 230 阅读 · 0 评论