约数之和

#include<iostream>
#include<algorithm>
#include<unordered_map>
using namespace std;
typedef long long LL;
const int N=1e9+7;
int n;

int main(void){
    cin>>n;
    unordered_map<int,int>prime;
    for(int i=0,a;i<n;i++){
        cin>>a;
        for(int i=2;i<=a/i;i++)
            while(a%i==0){
                a/=i;
                prime[i]++;
            }
        if(a>1)prime[a]++;
    }
    LL res=1;
    for(auto x:prime){
        LL t=1;
        int a=x.first,b=x.second;
        while(b--)t=(a*t+1)%N;
        res=res*t%N;
    }
    cout<<res%N<<endl;
    return 0;
}

 

posted @ 2019-07-21 16:01  YF-1994  阅读(104)  评论(0编辑  收藏  举报