int gcd(int a, int b)
{
return b ? gcd(b, a % b) : a;
}
int sum()
{
int n;
cin >> n;
unordered_map<int, int> primes;
int x;
cin >> x;
for (int i = 2; i <= x / i; i ++ )
while (x % i == 0)
{
x /= i;
primes[i] ++ ;
}
if (x > 1) primes[x] ++ ;
LL res = 1;
for (auto p : primes)
{
LL a = p.first, b = p.second;
LL t = 1;
while (b -- ) t = (t * a + 1) % mod;
res = res * t % mod;
}
cout << res << endl;
}
约数之和/最大公约数模板
最新推荐文章于 2023-03-13 17:29:37 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)