码迷,mamicode.com
首页 >  
搜索关键字:mod    ( 18094个结果
URAL 1141. RSA Attack RSA加密算法
题目来源:URAL 1141. RSA Attack 题意:给你e n c 并且有m^e = c(mod n) 求 m 思路:首先学习RSA算法 here  过程大致是 1.发送的信息是m 2.随机选择两个质数 p和q, n = q*p, n的欧拉函数值φ(n)= (p-1)*(q-1)这个需要证明  3.选择一个与φ(n)互质的并且小于φ(n)的数e, 计算c = m^e(mod...
分类:其他好文   时间:2014-08-31 15:52:31    阅读次数:262
URAL 1204. Idempotents 扩展欧几里德
题目来源:URAL 1204. Idempotents 题意:输入n(n = p*q p,q是质数) 并且x*x=x(mod n) 求x 思路: x*x=x(mod n)  -> x*x+k*n=x -> x*(x-1)/n = k 所以 0 和 1 是一组解 因为n = p*q 且x*(x-1)%(p*q)== 0 x 1.x有p因子x-1有q因子 x%p == 0且(x-1)%q =...
分类:其他好文   时间:2014-08-31 14:33:11    阅读次数:203
js使用栈来实现10进制转8进制 js取除数 余数
function ten2eight(x){var s=[];var r='';while(x>0){ s.push(x%8); x=parseInt(x/8);}while(s.length>0){ r=r+s.pop();}return r;}N=(N div 8)*8+(N mod 8) (....
分类:Web程序   时间:2014-08-31 10:30:21    阅读次数:239
BZOJ2724: [Violet 6]蒲公英
2724: [Violet 6]蒲公英Time Limit:40 SecMemory Limit:512 MBSubmit:795Solved:248[Submit][Status]DescriptionInput修正一下l = (l_0 + x - 1) mod n + 1, r = (r_0 +...
分类:其他好文   时间:2014-08-31 00:21:00    阅读次数:491
Codeforces 462D Appleman and Tree 树形dp
题目链接:点击打开链接 #include #include #include #include #include using namespace std; #define N 300100 #define mod 1000000007 typedef long long ll; ll dp[N][2]; //dp[i][1]表示i点已经归属于某个黑点的方法数 //dp[i][...
分类:移动开发   时间:2014-08-30 23:11:50    阅读次数:438
HDU 1061 EASY
//回宿舍去了,明天做点难一点的题,今天做的都很水,感觉。没意思。#include #include using namespace std;const __int64 MOD=10; __int64 Power(__int64 a,__int64 b,__int64 m){ a%=m; __...
分类:其他好文   时间:2014-08-30 23:00:30    阅读次数:197
哈希表
哈希函数的构造方法:1,直接定址法2,数字分析法3,平方取中法4,折叠法5,保留余数法6,随机数法处理冲突的方法:1,开放地址法:Hi = ( H(key) + di) MOD m i=1,2,....,k(k <= m-1) di =1,2,3,...,m-1称为线性...
分类:其他好文   时间:2014-08-30 22:53:50    阅读次数:276
POJ 3070
水题,结果MOD 10000#include #include using namespace std;int n=2,M=10000;struct Matrax { int m[35][35];}; Matrax a,per; void initial(){ int i,j; f...
分类:其他好文   时间:2014-08-30 21:41:50    阅读次数:268
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
Android ROM 制作教程
本文来自: 起点手机论坛 具体文章參考:http://www.qdppc.com/forum.php?mod=viewthread&tid=43751&fromuid=11、Android系统是什么?Android是Google公司于2007年公布的基于Linux的移动终端系统平台。之所以说是移动终...
分类:移动开发   时间:2014-08-30 17:35:59    阅读次数:416
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!