约数之和 -2025/11/10

约数之和

#include<bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
typedef long long ll;
unordered_map<int,int> mp;

int main(){
	int n;
	cin >> n;
	
	while(n --){
		int t;
		cin >> t;
		
		for(int i = 2; i <= t / i; i++){
			if(t % i == 0){
				int s = 0;
				while(t % i == 0) t /= i, s ++;
				mp[i] += s;
			}
		}
		
		if(t > 1) mp[t] ++;
	}
	
	ll res = 1;
	
	for(auto [u , v] : mp){
		int a = u, b = v;
		ll t = 1;
		while(b -- ) t = (t * u + 1) % mod;
		res = res * t % mod;
	}
	
	cout << res << "\n";
	return 0;
}
posted @ 2025-11-12 15:40  XYu1230  阅读(5)  评论(0)    收藏  举报