码迷,mamicode.com
首页 >  
搜索关键字:rabin    ( 201个结果
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
Rabin-Miller算法
首先附上matrix67大神的讲解:------------------------------------------------------------------------------------------------------------------------------------...
分类:其他好文   时间:2014-08-03 23:10:56    阅读次数:365
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
文件相似性判断 -- 超级特征值(super feature)
基于内容的变长分块(CDC)技术,可以用来对文件进行变长分块,而后用来进行重复性检测,广泛用于去重系统中。后来又出现了对相似数据块进行delta压缩,进一步节省存储开销。所以就需要一种高效的相似性检测算法,在论文 WAN Optimized Replication of Backup Datasets Using Stream-Informed Delta Compression 提出的sup...
分类:其他好文   时间:2014-07-29 18:02:42    阅读次数:325
优化后的二次测试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
文件分块上传客户端实现
首先对文件按内容分块(有块大小的约束),然后对于每个chunk构造单独的一个UDP 数据报进行传输,在应用层的开始是自定义的包头,有块号,块长度,块指纹等元数据信息,这些信息便于接收端能够按序正确接收。 /*--vonzhou ---this project is to upload file after chunking using rabin fingerprint, h...
分类:其他好文   时间:2014-06-18 12:27:16    阅读次数:171
HDu 2138 How many prime numbers 高效Miller素数测试
题目就是给出一组数,让我们测试其中有多少个是素数。 求素数有测试sqrt(n)个数的方法,有筛子方法,不过对于本题这样的题目来说就都不是高效的。 本题使用Miller Rabin素数测试法,效率奇高,对于不是极其大的整数测试都几乎是常数时间。令人神往的算法啊。 网上有个程序,好像是什么吉林的模板程序,不过我一直没看懂他是什么思路写的,是个AC的程序,不过却是错误的,呵呵,因为程序一直把9当做...
分类:其他好文   时间:2014-06-15 18:48:07    阅读次数:194
Millar_rabin和Pollard_Rho
1.Millar_rabin 素数判定 基于以下两个基础: 1.如果p是素数,且(a,p)=1,那么(a^(p-1))%p=1(费马小定理) 2.对于0 x=1 或者 x=p-1 处理: 把p-1写成u*(2^t),则a^(p-1)=(a^u)^2^2^2.....t次平方操作 过...
分类:其他好文   时间:2014-06-10 00:39:41    阅读次数:229
201条   上一页 1 ... 18 19 20 21 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!