标签:log com result div ges images width base turn
2017-07-20 17:47:25
writer:pprp
介绍:二分求幂原理:
一般用递归求解:
代码如下:
int power(ll base,unsigned int exponent) { if(exponent == 0) { return 1; } if(exponent == 1) { return base; } double result = power(base,exponent>>1); result *= result; if(exponent%2 == 1) result *= base; return result; }
属于数论,遇到具体的题目还是有点问题
标签:log com result div ges images width base turn
原文地址:http://www.cnblogs.com/ilovelianghui/p/7212556.html