快速冪算法 (複雜度log2(n))

#include<bits/stdc++.h> using namespace std; typedef long long ll; const ll mod=1e9+7; ll qpow(ll a,ll b){     ll ans=1;     while(b){         if(b%2==1){             ans=(ans*a)%mod;         }      
相關文章
相關標籤/搜索