摘要:
按照线性筛法求质数的方法,用O(n)的时间,求出1 ~ n中每一个数的欧拉函数 在线性筛的过程中,顺便求欧拉函数 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int N = 1e6 + 10; 4 typedef long lo 阅读全文
摘要:
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int mod = 1e9 + 7; 5 int gcd(int a, int b) { 6 return b ? gcd(b, a % 阅读全文
摘要:
如何求一个数约数的个数以及如何求一个数约数的和:基于算数基本定理 题目一:约数个数 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int mod = 1e9 + 7; 5 int m 阅读全文