![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
唯一分解定理(数论)
dukig
尽人事,知天命。
展开
-
唯一分解定理(概念)
typedef long long ll; ll fac[10050], num;//素因数,素因数的个数 void init(ll n) {//唯一分解定理 num = 0; ll cpy = n; int m = (int)sqrt(n + 0.5); for (int i = 2; i <= m; ++i) { if (cpy % i ...转载 2019-04-03 00:37:32 · 171 阅读 · 0 评论 -
Choose and divide UVA - 10375
链接:https://vjudge.net/problem/UVA-10375 题意:给定公式 C(m,n) = m!/((m-n)!*n!)),给定4个数p,q,r,s,求C(p,q)/C(r,s); 思路:为阶层的每一个数用唯一分解定理分解。 这种大数相除精度高的题要用唯一分解定理。 #include<iostream> #include<algorithm>...原创 2019-04-03 14:58:19 · 72 阅读 · 0 评论 -
Poj 1845 (唯一分解定理+快速幂+逆元)
链接:https://vjudge.net/problem/POJ-1845 题意:给定2个自然数a,b,求a^b的所有约数的和 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #define mod 99...原创 2019-04-03 17:42:06 · 134 阅读 · 0 评论