摘要: 求∑1/i,但是范围很大 和bitmap的想法一样,分个块,均摊复杂度就降下来了 //到底排行榜上的0ms是怎么做到的? C++ include using namespace std; const int maxn = 1e6+11; const int N = 1e8; double tmp[N 阅读全文
posted @ 2018-01-10 22:36 Caturra 阅读(117) 评论(0) 推荐(0)
摘要: 简单欧拉函数递推 用埃式筛会吃亏 C++ include include include include using namespace std; const int maxn = 5e6+11; typedef unsigned long long ll; ll phi[maxn]; void e 阅读全文
posted @ 2018-01-10 17:27 Caturra 阅读(121) 评论(0) 推荐(0)
摘要: 结论题:小于n的所有互质数之和为phi(n) n/2 阅读全文
posted @ 2018-01-10 16:33 Caturra 阅读(114) 评论(0) 推荐(0)
摘要: 结论:如果p是n的约数,那么满足gcd(i,n)==p的i的个数是Φ(n/p) 阅读全文
posted @ 2018-01-10 15:58 Caturra 阅读(134) 评论(0) 推荐(0)
摘要: 欧拉函数测试题 期末考试完了做下水题 更好的方法是phi[i]==i时就直接筛选,不改了 C++ include using namespace std; const int maxn = 4e4+11;; typedef unsigned long long ll; bool isnprime[m 阅读全文
posted @ 2018-01-10 00:32 Caturra 阅读(135) 评论(0) 推荐(0)