阶乘约数——唯一分解定理

在这里插入图片描述
思路: 直接运用唯一分解定理可解。

唯一分解定理传送门(点我)在这里插入图片描述在这里插入图片描述

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200],ans=1,n;

int main()
{
    
    
    for(int i=2;i<=100;i++){
    
    
        n=i;
        for(int j=2;j<=n;j++){
    
    while(n%j==0)a[j]++,n/=j;}
    }
    for(int i=2;i<=100;i++)if(a[i])ans*=(a[i]+1);
	return cout<<ans<<endl,0;
}

输出答案:39001250856960000

猜你喜欢

转载自blog.csdn.net/weixin_43615816/article/details/114802443