码迷,mamicode.com
首页 >  
搜索关键字:mod    ( 18094个结果
扩展baby step giant step模版
#include #include #include #include using namespace std; typedef __int64 LL; LL gcd(LL a, LL b) { return b ? gcd(b, a%b) : a; } LL pow_mod(LL a, LL p, LL n) { LL ans = 1; while(p) { if(p&1) ...
分类:其他好文   时间:2015-03-16 17:51:51    阅读次数:164
话说内核模块间的依赖
每个模块在编译时(假设模块名为xxx),会自动生成一个xxx.mod.c的文件,该文件会链接到xxx模块中去。 xxx.mod.c中定义了一个变量struct module __this_module以及此模块依赖的模块列表__module_depends。 __module_depends的定义如下,可见其内容是在加载时动态生成。 static const char __module_de...
分类:其他好文   时间:2015-03-16 16:32:28    阅读次数:793
gcd,扩展欧几里得,中国剩余定理
1.gcd:int gcd(int a,int b){ return b==0?a:gcd(b,a%b);}2.中国剩余定理:题目:学生A依次给n个整数a[],学生B相应给n个正整数m[]且两两互素,老师提出问题:有一正整数ans,对于每一对数,都有:(ans-a[i])mod m[i]=0....
分类:其他好文   时间:2015-03-16 00:55:50    阅读次数:224
快速幂&快速乘
LL mult_mod(LL a, LL b, LL c){ a %= c; b %= c; LL ret = 0; LL tmp = a; while (b){ if (b & 1){ ret += tmp; if...
分类:其他好文   时间:2015-03-15 18:25:38    阅读次数:164
通用 PE 工具箱1.9.6(XP内核)by Uepon(李培聪)
通用 PE 工具箱1.9.6(XP内核)by Uepon(李培聪)官网:http://hi.baidu.com/uepon?page=21.8版论坛帖子:http://bbs.wuyou.net/forum.php?mod=viewthread&tid=119749通用PE1.9.6介绍:http:...
分类:其他好文   时间:2015-03-15 18:12:01    阅读次数:1544
Delphi运算符总结
分类运算符操作操作数结果类型范例算术运算符+加整数,实数整数,实数X + Y-减整数,实数整数,实数Result - 1*乘整数,实数整数,实数P * InterestRate/实数除整数,实数实数X / 2div整数除整数整数Total div UnitSizemod取模整数整数Y mod 6+(...
分类:Windows程序   时间:2015-03-15 13:47:14    阅读次数:144
hdu5187 奇怪题
本来很水的,答案就是(2^n)-2,但是写坑了QAQ因为原题要求答案要mod P,一开始我是这么干的: LL ans=pow_mod(2,N,P); ans=(ans-2)%P; if (N==1) ans=1%P; printf("%I6...
分类:其他好文   时间:2015-03-15 12:17:32    阅读次数:139
扩展欧几里得算法模板题 zoj 3609
Modular Inverse Time Limit: 2 Seconds      Memory Limit: 65536 KB The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equiv...
分类:编程语言   时间:2015-03-15 09:30:03    阅读次数:207
快速幂模版
快速幂模版快速幂的思想是分治,根据题目的数据要注意long long快速幂普通版,比取余版快,但容易超范围,慎用,一般可用取余版MOD设为INF://快速幂普通版(未取余)long long quickpow(long long n,long long k){ long long res=1;...
分类:其他好文   时间:2015-03-15 02:01:34    阅读次数:102
CubieTruck入手第一天
主要的参考资料整理如下: 新人上手第一步 for 菜鸟:http://forum.cubietech.com/forum.php?mod=viewthread&tid=160 Cubieboard 开箱和入门:http://name5566.com/4398.html Windows平台下安装PhoenixSuit要点:http://forum.cubiete...
分类:其他好文   时间:2015-03-14 21:49:23    阅读次数:158
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!