「一本通 6.2 练习 5」樱花
作者:互联网
/*
reference:
Date:
2019.10.09
sol:
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
template <typename T>inline void rd(T &x){x=0;char c=getchar();int f=0;while(!isdigit(c)){f|=c=='-';c=getchar();}while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();}x=f?-x:x;}
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dwn(i,a,b) for(int i=(a);i>=(b);--i)
#define mem(a,b) memset(a,b,sizeof(a))
#define ee(i,u) for(int i=head[u];i;i=e[i].next)
const int N =1e6+10,mod=1e9+7;
int n,tot_p;
int v[N],p[N];
int ans=1;
inline void shai(){
rep(i,2,N){
if(v[i]==0){
v[i]=i;
p[++tot_p]=i;
}
rep(j,1,tot_p){
if(p[j]>v[i] || p[j]>N/i)break;
v[i*p[j]]=p[j];
}
}
}
#undef int
int main(){
#define int long long
#ifdef WIN32
freopen("yinghua.txt","r",stdin);
#endif
rd(n);
shai();
for(int i=1;p[i]<=n;++i){
int now=p[i];
int cnt=0;
while(now<=n){
cnt+=n/now;
now*=p[i];
}
// (ans*=(cnt<<1|1)%mod)%mod;//这种写法会爆,以后千万不能这样写了!!!
ans=(ans*(cnt<<1|1)%mod)%mod;
}
printf("%lld",ans);
return 0;
}
标签:樱花,tot,int,练习,long,6.2,isdigit,getchar,define 来源: https://www.cnblogs.com/sjsjsj-minus-Si/p/11642316.html