long long quick_pow(int a,int n) { long long result; if(n == 1) return a; if(!n) return 1; long long mid = quick_pow(a,n/2); if(n%2) result = mid*mid%modx*a%modx; else result = mid*mid%modx; return result; //zzzzz}
本文共 310 字,大约阅读时间需要 1 分钟。
long long quick_pow(int a,int n) { long long result; if(n == 1) return a; if(!n) return 1; long long mid = quick_pow(a,n/2); if(n%2) result = mid*mid%modx*a%modx; else result = mid*mid%modx; return result; //zzzzz}
转载于:https://www.cnblogs.com/Aragaki/p/7226637.html