From 07017cc8f17bde063c138ccb1b681ded11c7b720 Mon Sep 17 00:00:00 2001 From: hanyixuanten <105723997+hanyixuanten@users.noreply.github.com> Date: Sat, 15 Aug 2026 16:58:18 +0800 Subject: [PATCH] new file: P1593.cpp --- P1593.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 P1593.cpp diff --git a/P1593.cpp b/P1593.cpp new file mode 100644 index 0000000..7aea9ed --- /dev/null +++ b/P1593.cpp @@ -0,0 +1,40 @@ +// 97 +#include +#include +#include +#define int long long +using namespace std; +const int mod = 9901; +int pow(int a, int b, int p) +{ + a %= p; + int res = 1; + while (b > 0) + { + if (b % 2) + res *= a, res %= p; + a = a * a % p, b >>= 1; + } + return res; +} +signed main() +{ + int a, b; + scanf("%lld%lld", &a, &b); + map yuec; + for (int i = 2; a > 1; i++) + while (a % i == 0) + yuec[i]++, a /= i; + int ans = 1; + for (pair i : yuec) + { + if ((i.first - 1) % mod == 0) + ans *= (i.second * b + 1) % mod; + else + ans *= (pow(i.first, i.second * b + 1, mod) - 1) * pow(i.first - 1, mod - 2, mod)%mod; + ans %= mod; + } + if(!a) ans=0; + printf("%lld\n", (ans+mod)%mod); + return 0; +} \ No newline at end of file