LS的运行结果是一样的吧
程序代码:#include<cstdio>
__int64 quickpow(__int64 a,__int64 k,__int64 mod)
{
__int64 temp=1;
while(k>0){
if(k&1)
temp=(a%mod)*(temp%mod)%mod;
a=(a%mod)*(a%mod)%mod;
k/=2;
}
return temp;
}
int main()
{
__int64 a,k,m;
while(~scanf("%I64d%I64d%I64d",&a,&k,&m)){
printf("%I64d\n",quickpow(a,k,m));
}
return 0;
}









