ll quickpow(ll a,ll b,ll p) //(a^b)%p
{
    ll res=1%p;
    a%=p;
    while(b!=0)
    {
        if(b&1)
            res=(res*a)%p;
        a=(a*a)%p;
        b>>=1;
    }
    return res;
}

 

 

long double quickmi(long double a,int b)
{
    long double t=1;
    for (; b; b>>=1,a=a*a)
        if (b&1) t=t*a;
    return t;
}

 

posted on 2020-12-22 21:24  MZRONG  阅读(104)  评论(0编辑  收藏  举报