数论
拼自己想要的未来
这个作者很懒,什么都没留下…
展开
-
素勾股数
以下的方法可用来找出勾股数。设 m > n 、 m 和 n 均是正整数, {\displaystyle a=m^{2}-n^{2}}{\displaystyle b=2mn}{\displaystyle c=m^{2}+n^{2}} 若 m 和 n 是互质,而且 m 和 n 其中有一个是偶数,计算出来的 (a, b, c) 就是素勾股数。(若 m 和 n 都是奇数, (a, b,转载 2017-07-08 12:21:37 · 1782 阅读 · 0 评论 -
线性 素数筛
#include using namespace std; typedef long long ll; const ll Maxn=1000000+10; int prim[Maxn+100],used[Maxn+100],ans; void solve(){ for(long long i=2;i if(!used[i]){原创 2017-07-08 17:42:07 · 212 阅读 · 0 评论 -
Hdu 6069
Problem Description In mathematics, the function d(n) denotes the number of divisors of positive integer n. For example, d(12)=6 because 1,2,3,4,6,12 are all 12's divisors. In this prob原创 2017-08-05 16:16:17 · 166 阅读 · 0 评论