0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:28:47 +00:00
Baoshuo Ren 2021-09-16 19:54:15 +08:00 committed by Baoshuo Ren
parent 18f78198af
commit 13451e4757
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

32
AcWing/871/871.cpp Normal file
View File

@ -0,0 +1,32 @@
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int n, x;
long long ans = 1;
int main() {
cin >> n;
map<int, int> primes;
while (n--) {
cin >> x;
for (int i = 2; i * i <= x; i++) {
while (x % i == 0) {
x /= i;
primes[i]++;
}
}
primes[x] += x > 1;
}
for (auto p : primes) {
long long t = 1;
while (p.second--) {
t = (t * p.first + 1) % mod;
}
ans = ans * t % mod;
}
cout << ans << endl;
return 0;
}