
数论
leifjacky
这个作者很懒,什么都没留下…
展开
-
求两个或N个数的最大公约数(gcd)和…
感谢作者原文:http://www.cppblog.com/linqiu/archive/2007/08/01/29145.html #include#includeusing namespace std; int gcd(int a, int b);int ngcd(int *a, int n);int lcm(int a, int b);int nlc转载 2014-12-13 08:22:34 · 2489 阅读 · 0 评论 -
数论之因子个数的求法
原文地址:数论之因子个数的求法作者:在黑的道路上1.N的因子个数 条件:给定任意一个一个正整数N要求:求其因子的个数首先给出结论:对于任意的整型N,分解质因数得到N=P1^x1 * P2^x2* …… * Pn^xn;则N的因子个数M为 M=(x1+1) *(x2+1) * …… *(xn+1); 证明过程: 首先举个例子吧24 =2^3 * 3^1;其质因子有:为转载 2014-12-13 08:22:31 · 849 阅读 · 0 评论 -
HDU 4342 - History repeat itself
C - History repeat itselfTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 4342DescriptionTom took the Discrete Mathematics cou原创 2016-04-26 16:58:31 · 405 阅读 · 0 评论