2018年11月29日

快速幂

摘要: template<class T,class T1> T fast_mod(T a,T b,T1 Mod){ a%=Mod; if(b==0) return 1; T ans=1,base=a; while(b!=0){ if(b&1)ans=(ans*base)%Mod; base=(base*b 阅读全文

posted @ 2018-11-29 23:39 欣崽 阅读(137) 评论(0) 推荐(0) 编辑

合数分解

摘要: const int maxn=30000+5; int prime[maxn]; void marktable(int n){ memset(prime,0,sizeof(prime)); for(int i=2;i<=n;i++){ if(!prime[i]) prime[++prime[0]]=i; for(int j=1;j<=prim... 阅读全文

posted @ 2018-11-29 23:17 欣崽 阅读(656) 评论(0) 推荐(0) 编辑

扩展欧几里得算法+获取特殊的解

摘要: 通过扩展欧几里得算法获取x或者y的最小整数解 阅读全文

posted @ 2018-11-29 18:47 欣崽 阅读(571) 评论(0) 推荐(0) 编辑

导航