求∑1<=i<=n∑1<=j<=ngcd(i,j) % P P = 10^9 + 7 2 <= n <= 10^10 这道题,明显就是杜教筛 推一下公式: 利用∑d|nphi(d) = n ans = ∑1<=i<=n∑1<=j<=n∑d|(i,j)phi(d) = ∑1<=d<=n∑1<=i<=n∑1<=j<=n[d|(i,j)]phi(d) = ∑1<=d<=nphi(d)∑1<=i<…
1238 最小公倍数之和 V3 三种做法!!! 见学习笔记,这里只贴代码 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; const int N = 4641590, U = 4641588, mo = 1e9+7, in…