码迷,mamicode.com
首页 >  
搜索关键字:miller-rabin    ( 128个结果
POJ 3641
主要是为了试一下MILLER-RABIN的方法#include #include #include #include #define LL __int64using namespace std;const LL TIME=1000;LL random(LL n){ return (LL)((doub...
分类:其他好文   时间:2014-09-06 09:45:02    阅读次数:176
数论 - Miller_Rabin素数测试 + pollard_rho算法分解质因数 ---- poj 1811 : Prime Test
Prime TestTime Limit:6000MSMemory Limit:65536KTotal Submissions:29046Accepted:7342Case Time Limit:4000MSDescriptionGiven a big integer number, you are...
分类:其他好文   时间:2014-09-03 00:03:15    阅读次数:732
Miller_Rabin大素数测试与Pollard_rho整数分解模版
#include #include #include #include using namespace std; typedef __int64 LL; const int Times = 20; LL factor[100], l; LL gcd(LL a, LL b) { return b ? gcd(b, a%b):a; } LL add_mod(LL a, LL b, LL n)...
分类:其他好文   时间:2014-08-30 20:28:20    阅读次数:285
Miller_Rabin大素数测试与Pollard_rho整数分解模版
#include #include #include #include using namespace std; typedef __int64 LL; const int Times = 20; LL factor[100], l; LL gcd(LL a, LL b) { return b ? gcd(b, a%b):a; } LL add_mod(LL a, LL b, LL n)...
分类:其他好文   时间:2014-08-19 20:57:05    阅读次数:254
HDU 3864 D_num Miller Rabin 质数判断+Pollard Rho大整数分解
随机算法,Miller Rabin和Pollard Rho的应用...
分类:其他好文   时间:2014-08-09 18:46:48    阅读次数:176
HDU2138 随机素数测试 Miller-Rabin算法
题目描述 Give you a lot of positive integers, just to find out how many prime numbers there are.. In each case, there is an integer N representing the num...
分类:其他好文   时间:2014-07-30 23:35:35    阅读次数:300
优化后的二次测试Miller_Rabin素性测试算法
ll random(ll n){ return (ll)((double)rand()/RAND_MAX*n + 0.5);}ll pow_mod(ll a,ll p,ll n){ if(p == 0) return 1; ll ans = pow_mod(a,p/2...
分类:其他好文   时间:2014-07-01 12:29:43    阅读次数:218
HDu 2138 How many prime numbers 高效Miller素数测试
题目就是给出一组数,让我们测试其中有多少个是素数。 求素数有测试sqrt(n)个数的方法,有筛子方法,不过对于本题这样的题目来说就都不是高效的。 本题使用Miller Rabin素数测试法,效率奇高,对于不是极其大的整数测试都几乎是常数时间。令人神往的算法啊。 网上有个程序,好像是什么吉林的模板程序,不过我一直没看懂他是什么思路写的,是个AC的程序,不过却是错误的,呵呵,因为程序一直把9当做...
分类:其他好文   时间:2014-06-15 18:48:07    阅读次数:194
128条   上一页 1 ... 11 12 13
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!