摘要: Description Input 一共T+1行 第1行为数据组数T(T using namespace std; define ll long long void read(int &x) { x=0;int f=1;char ch=getchar(); for(;!isdigit(ch);ch= 阅读全文
posted @ 2018-12-05 21:51 Hyscere 阅读(232) 评论(0) 推荐(0) 编辑
摘要: Description 去年的Lucas非常喜欢数论题,但是一年以后的Lucas却不那么喜欢了。 在整理以前的试题时,发现了这样一道题目“求Sigma(f(i)),其中1 using namespace std; define int long long void read(int &x) { x= 阅读全文
posted @ 2018-12-05 19:42 Hyscere 阅读(324) 评论(0) 推荐(0) 编辑
摘要: Description 很久很久以前,有一只神犇叫yzy; 很久很久之后,有一只蒟蒻叫lty; Input 请你读入一个整数N;1 using namespace std; define int long long void read(int &x) { x=0;int f=1;char ch=ge 阅读全文
posted @ 2018-12-05 16:16 Hyscere 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 整除分块 这个是学习莫比乌斯反演需要的预备知识,几乎所有这类的题都需要用到这个。 考虑下面这个式子: $$ \sum_{i=1}^{n}\lfloor\frac{n}{i}\rfloor $$ 这个当然可以$O(n)$算,但是很多时候这样还不够快,于是下面有一个$O(\sqrt{n})$的算法。 ~ 阅读全文
posted @ 2018-12-05 14:20 Hyscere 阅读(257) 评论(0) 推荐(0) 编辑