2721: [Violet 5]樱花
Time Limit: 5 Sec Memory Limit: 128 MBSubmit: 648 Solved: 380
Description
Input
Output
Sample Input
Sample Output
HINT
Source
/**************************************************************
Problem: 2721
User:
Language: C++
Result: Accepted
Time:72 ms
Memory:6172 kb
****************************************************************/
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 137, mod = 1e9 + 7;
int pri[N], tot;
bool isp[N];
void Linear_Shaker( int n )
{
for(int i = 2; i <= n; ++i)
{
if(!isp[i]) pri[++tot] = i;
for(int j = 1; j <= tot && pri[j] * i <= n; ++j)
{
isp[pri[j] * i] = 1;
if(i % pri[j] == 0) break;
}
}
}
int n;
int main()
{
cin >> n;
Linear_Shaker(n);
int ans = 1;
for(int i = 1; i <= tot; ++i)
{
int tmp = n, cnt = 0;
while(tmp)
cnt += tmp / pri[i], tmp /= pri[i];
cnt = (cnt << 1 | 1);
ans = 1LL * ans * cnt % mod;
}
cout << ans << endl;
return 0;
}