快速幂介绍
快速幂是用了二进制优化。
模板题
P1226 【模板】快速幂
#include<bits/stdc++.h>
using namespace std;
#define int long long
int fast_pow(int a,int b,int mod)//分别是底数、幂次、模式
{
int ans = 1;//答案
while(b)
{
if(b & 1)
{
ans = (ans * a)

最低0.47元/天 解锁文章
1182

被折叠的 条评论
为什么被折叠?



