求调 72分 #7#8WA

P1226 【模板】快速幂

@[huyiheng](/user/1224510) 应该是a%p* t *t乘爆了 应该为(a%p*(t*t)%p)%p
by zzs2731 @ 2023-12-09 14:58:25


@[huyiheng](/user/1224510) 也可以改成这样 ``` l quickpow(l a,l b,l p){ l res = 1 % p; while(b>0){ if(b&1) res=(res*a)%p; a=(a*a)%p; b>>=1;} return res; } ```
by 15caoyichen @ 2023-12-15 20:08:25


@[15caoyichen](/user/983373) 懂了,这是快速幂模板
by huyiheng @ 2023-12-17 22:43:28


|