mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 14:56:27 +00:00
870. 约数个数
https://www.acwing.com/problem/content/submission/code_detail/7761573/
This commit is contained in:
parent
e63bc3ff36
commit
18f78198af
28
AcWing/870/870.cpp
Normal file
28
AcWing/870/870.cpp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#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) {
|
||||||
|
ans = ans * (p.second + 1) % mod;
|
||||||
|
}
|
||||||
|
cout << ans << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user