2013年9月8日

rabin 素性检验 随机化算法

摘要: 1 #include 2 #include 3 #include 4 typedef long long int LL; 5 inline bool qpow(int a,int x) 6 { 7 int b = x-1,ans = 1; 8 while(b) 9 {10 if(b&1) ans = (LL)ans*a%x;11 a = (LL)a*a%x;12 b >>= 1;13 }14 if(ans == 1) return true;15 else return false;16 }... 阅读全文

posted @ 2013-09-08 21:54 allh123 阅读(257) 评论(0) 推荐(0) 编辑

导航