求助!34分,有几个点WA了,哪错了?
查看原帖
求助!34分,有几个点WA了,哪错了?
720390
liumusi2022楼主2022/7/13 16:00
#include<bits/stdc++.h>
using namespace std;
long long a, b, s, ans, mod = 1e8;
long long qpow(long long x, long long y)
{
	long long s = 1;
	while(y) 
	{
		if(y & 1)
		{
			s = (x * s) % mod;
		}
		x = (x * x) % mod;
		y >>= 1;
	}
	return s;
}
int main()
{
	cin >> a >> b;
	s = qpow(a, b);
	for(int i = 1; i <= s / i; i++)
	{
		if(s % i == 0) ans += s / i + i;
		if(i * i == s) ans -= i;
		ans %= mod;
	}
	cout << ans % 9901;
	return 0;
}
2022/7/13 16:00
加载中...