标签:style namespace bsp print inf 快速幂 快速 while log
#include "bits/stdc++.h" using namespace std; #define LL long long #define INF 0x3f3f3f3f3f #define PI acos(-1) #define N 510 #define MOD 10 LL quickPow(LL a,LL b) { LL ans=1; while(b>0){ if(b&1){ ans=ans*a%MOD; } b>>=1; a=a*a%MOD; } return ans; } int main() { int n,k; while(~scanf("%d",&n)){ printf("%lld\n",quickPow(n,n)); } return 0; }
标签:style namespace bsp print inf 快速幂 快速 while log
原文地址:http://www.cnblogs.com/kimsimple/p/7460762.html