From 18f78198af16803027a2808d1882ba502cc0e553 Mon Sep 17 00:00:00 2001 From: Ren Baoshuo Date: Thu, 16 Sep 2021 19:40:04 +0800 Subject: [PATCH] =?UTF-8?q?870.=20=E7=BA=A6=E6=95=B0=E4=B8=AA=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://www.acwing.com/problem/content/submission/code_detail/7761573/ --- AcWing/870/870.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 AcWing/870/870.cpp diff --git a/AcWing/870/870.cpp b/AcWing/870/870.cpp new file mode 100644 index 00000000..104b6588 --- /dev/null +++ b/AcWing/870/870.cpp @@ -0,0 +1,28 @@ +#include + +using namespace std; + +const int mod = 1000000007; + +int n, x; +long long ans = 1; + +int main() { + cin >> n; + map 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; +}