#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<cstring>
#include<string>
#include<math.h>
#include<algorithm>
#include<set>
#include<vector>
#define LL long long
#define INF 0x3f3f3f3f
#define mod 1e9+7
using namespace std;
LL solve(int e, int x)
{
LL ans = 1;
while(x){
if(x & 1) ans *= e;///这里只有奇数才会进行运算额
e *= e;
x = x >> 1;
}
return ans;
}
int main()
{
printf("%lld\n",solve(2,5));
return 0;
}
快速幂模板
最新推荐文章于 2018-06-21 13:49:02 发布