题目链接:传送门
别人的题解 不想写那么多latex了
化完式子之后就是求的约数个数
#include <bits/stdc++.h>
#define
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
ll cc[A], pri[A]; int n, cnt; bool bz[A];
int main(int argc, char const *argv[]) {
cin >> n;
for (int i = 2; i <= n; i++) {
if (!bz[i]) pri[++cnt] = i;
for (int j = 1; j <= cnt and i * pri[j] <= n; j++) {
bz[i * pri[j]] = 1;
if (i % pri[j] == 0) break;
}
}
ll ans = 1;
for (int i = 1; i <= cnt; i++) //算出每个质因子的出现个数↓↓↓
for (ll j = pri[i]; j <= n; j *= pri[i]) cc[i] = (cc[i] + n / j) % mod;
for (int i = 1; i <= cnt; i++) ans = ans * (cc[i] * 2 % mod + 1) % mod;
cout << ans << endl;
}