摘要: #数论模板 ##1.快速幂 模板 int mypow(int a,int b ,int p) { ll ans=1; while(b) { if(b&1) ans=ans*a%p; a=(ll)a*a%p; b>>=1; } return ans%p; } ##2.筛法 ###2.1埃氏筛法 模板 阅读全文
posted @ 2021-07-29 08:30 巴扎嘿~ 阅读(48) 评论(0) 推荐(0) 编辑
摘要: #数论之快速幂 模板: int quick_pow(int a,int b,int P) { int res=1; while(b) { if(b&1) res=(long long)res*a%P; a=(long long)a*a%P; b>>=1; } return res; } 注意运算时可 阅读全文
posted @ 2021-07-29 08:19 巴扎嘿~ 阅读(36) 评论(0) 推荐(0) 编辑