unsigned long ComputeR(unsigned long B, unsigned long P, unsigned long M){
if (P==1) return B % M;
unsigned long i,res=1;
i=1;
res = B%M;
while(2*i<P){
res = (res*res)%M;
i*=2;
}
return (res * ComputeR(B,P-i,M))%M;
}
Solved by Wellwind
p274題目連結
回ACM題庫目錄
回首頁
沒有留言:
張貼留言