约数之和

#include<iostream>
using namespace std;
#define Mod 9901
#define ll long long
int a,b;
int ksm(int a,int b){
	int ans=1;
	a%=Mod;
	while(b){
		if(b&1){
			ans=ans%Mod*a;
		}
		a=a%Mod*a%Mod;
		b>>=1;
	}
	return ans;
}
ll sum(int p,int c){
	if(0==c){
		return 1;
		
	}
	if(c&1){
		return ((1+ksm(p,(c+1)>>1))*sum(p,(c-1)>>1))%Mod;
	}else{
		return ((1+ksm(p,c>>1))*sum(p,(c>>1)-1)+ksm(p,c))%Mod;
	}
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>a>>b;
	int ans=1;
	for(int i=2;i<=a;++i){
		int s=0;
		while(0==a%i){
			++s;
			a/=i;
		}
		if(s){
			ans=ans*sum(i,s*b)%Mod;
		}
	}
	if(0==a){
		cout<<0<<'\n';
	}else{
		cout<<ans<<'\n';
	}
	return 0;
}
posted @ 2022-03-10 14:25  ethon-wang  阅读(19)  评论(0编辑  收藏  举报