结论:一个数约数的个数:分解质因数,求出每个质因数的底数和指数,约数个数就等于每个质因数的(指数+1)求积。
对一个数分解质因数:
假设d是n的任意一个约数,那么一定有一对(β1,β2...βk)可以使下式成立。
那么,总的约数个数就等于所有β可能的取值个数相乘。
#include<bits/stdc++.h>
using namespace std;
const int mod=1000000007;
int n;
long long res=1;
unordered_map<int,int> hasharr;
void hashing(int x){
for(int i=2;i<=x/i;i++){
if(x%i==0){
while(x%i==0){
x=x/i;
hasharr[i]++;
}
}
}
if(x>1){
hasharr[x]++;
}
return ;
}
int main(){
cin>>n;
for(int i=1;i<=n;i++){
int x;
cin>>x;
hashing(x);
}
for(auto t:hasharr){
res=(res*(t.second+1))%mod;
}
cout<<res;
return 0;
}