![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
//返回pow(x,n)%mod ll mod_pow(ll x,ll n,ll mod) { ll res = 1; while(n>0) { if(n&0x1) res = res * x % mod; x = x*x % mod; n >>= 1; } return res; }
//返回pow(x,n)%mod ll mod_pow(ll x,ll n,ll mod) { ll res = 1; while(n>0) { if(n&0x1) res = res * x % mod; x = x*x % mod; n >>= 1; } return res; }
转载于:https://www.cnblogs.com/Asurudo/p/10628170.html