雕刻时光

just do it……nothing impossible
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2011年4月28日

摘要: /*******************************************************************************************这里包含了rabinmiller素数测试与pollard算法求解最小质因数的方法,函数说明放到每个函数的前面*******************************************************************************************/不是自己写的学习一下View Code /***************************************** 阅读全文

posted @ 2011-04-28 21:07 huhuuu 阅读(655) 评论(0) 推荐(0) 编辑

摘要: View Code #include<stdio.h>#include<math.h>int prim(int p){ int t=(int)sqrt(1.0*p); int i; for(i=2;i<=t;i++) { if(p%i==0) return 0; } return 1;}int mon(int x,int exp,int p){ if(exp==0) return 1; __int64 ret=mon(x,exp>>1,p); ret=(ret*ret)%p; if(exp&1) { ret =(ret*x)%p; } retu 阅读全文

posted @ 2011-04-28 19:49 huhuuu 阅读(391) 评论(0) 推荐(0) 编辑