From 009fe020fab0b52afc42c51d7a4d140c37eb81b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Ng=E1=BB=8Dc=20Ph=C3=BA=20T=E1=BB=B7?= <148174474+tynnp@users.noreply.github.com> Date: Wed, 4 Dec 2024 00:59:53 +0700 Subject: [PATCH] =?UTF-8?q?=C4=90=E1=BA=BFm=20s=E1=BB=91=20=C6=B0=E1=BB=9B?= =?UTF-8?q?c=20c=E1=BB=A7a=20s=E1=BB=91=20l=E1=BB=9Bn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UPCODER/Other/TEST_SGU_BUOI1_4.cpp | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 UPCODER/Other/TEST_SGU_BUOI1_4.cpp diff --git a/UPCODER/Other/TEST_SGU_BUOI1_4.cpp b/UPCODER/Other/TEST_SGU_BUOI1_4.cpp new file mode 100644 index 0000000..2314343 --- /dev/null +++ b/UPCODER/Other/TEST_SGU_BUOI1_4.cpp @@ -0,0 +1,50 @@ +#include +#include +#include + +using namespace std; +using namespace __gnu_pbds; + +#define endl '\n' +#define int long long +#define inp freopen("file.inp", "r", stdin) +#define out freopen("file.out", "w", stdout) +#define TIME 1.0*clock()/CLOCKS_PER_SEC +#define fastIO ios_base::sync_with_stdio(false); cin.tie(nullptr) +template using ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; +template using ordered_map = tree, rb_tree_tag, tree_order_statistics_node_update>; + +const int MAXN = 1e6 + 5; +const int MOD = 1e9 + 7; + +int n, totalDiv, primeDiv; +map fac; + +signed main() { + fastIO; + cin >> n; + + while (n % 2 == 0) { + fac[2]++; + n >>= 1; + } + + for (int i = 3; i*i <= n; i += 2) { + while (n % i == 0) { + fac[i]++; + n /= i; + } + } + + if (n > 2) + fac[n]++; + + totalDiv = 1; + primeDiv = fac.size(); + + for (auto &f : fac) + totalDiv *= (f.second + 1); + + cout << primeDiv << ' ' << totalDiv; + return 0; +} \ No newline at end of file