![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
math
文章平均质量分 76
H-Mays
这个作者很懒,什么都没留下…
展开
-
poj 3361 Gaussian Prime Factors 高斯素数约数
poj 3361 Gaussian Prime Factors题意:在复数 a+bj (a,b为整数)范围内,约数只有 1, -1, a+bj, -(a+bj)的称为高斯素数。求任给正整数N的所有素因子(|b|>a>0)。默认N<2e9解法:定理有云: n≡3(mod 4)者,无因式分解。 n≡1(mod 4)者,可唯一分解为两个共轭高斯整数乘积。当然做的时候并不知道! 我的思路是,既然可以原创 2015-07-07 21:45:38 · 734 阅读 · 0 评论 -
模运算
模运算(从点点搬运过来)1. 欧几里德算法——求最大公约数递归://initially a>b>=0,return greatest common divisorint gcd(int a,int b) { return b? gcd(b,a%b) : a; }非递归:#include <algorithm> int gcd(int a,int b) { while(a=a%b原创 2015-10-24 12:23:19 · 387 阅读 · 0 评论