![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数论
yjCola
这个作者很懒,什么都没留下…
展开
-
poj 1411 Calling Extraterrestrial Intelligence Again
链接:http://poj.org/problem?id=1411 题意:给出三个数:m,a,b(m > 4 and 0 ) ,求出两个数p、q满足p*qa/b 如果直接打素数表太过直接地暴力的话肯定是要超时的。此题保持10000以内的素数就够了,然后求每两个素数之积,保持两个素数中小的那个,打好标记。表打好后,直接从输入的m开始往下找直到找到第一组能满足条件的。 代码:原创 2013-09-29 14:06:24 · 805 阅读 · 0 评论 -
poj 3361 Gaussian Prime Factors(求高斯素数约数)
poj 3361 Gaussian Prime Factors 题目要求原创 2014-08-03 12:50:59 · 966 阅读 · 0 评论 -
poj 3421 X-factor Chains(分解质因数+组合数学)
幂和的阶乘/幂阶乘的和原创 2014-08-02 21:34:35 · 689 阅读 · 0 评论 -
poj 3604 Professor Ben(质因数分解)
poj 3604 Professor Ben原创 2014-08-02 18:08:30 · 645 阅读 · 0 评论 -
poj 3696 The Luckiest number(欧拉函数)
poj 3696 The Luckiest number 由题有 8原创 2014-08-02 17:21:43 · 565 阅读 · 0 评论 -
poj 1284 Primitive Roots(欧拉函数,原根定理)
poj 1284 Primitive Roots 想了半天没想出来怎么zuo原创 2014-06-06 21:09:36 · 721 阅读 · 0 评论 -
poj 2480 Longge's problem(欧拉函数或积性函数)
poj 2480 Longge's problem原创 2014-06-06 17:21:01 · 530 阅读 · 0 评论 -
poj 2478 Farey Sequence(欧拉函数)
poj 2478 Farey Sequence原创 2014-06-06 12:53:07 · 753 阅读 · 0 评论 -
hdu 1098 Ignatius's puzzle数论
链接:http://acm.hdu.edu.cn/showproblem.php?pid=1098 给出k值,求最小正整数a使对于任意整数满足65|f(x),f(x)=5*x^13+13*x^5+k*a*x 介绍下我第一次做的方法,网上大部分都是数学归纳得出的算法,代码看起来要简单些 首先一个多项式是否能被一个整数整除,只要将[1,最高次幂+1]依次代入x检测是否整除,若全部整除,则原创 2014-03-23 21:59:12 · 613 阅读 · 0 评论 -
数论的一些函数
#include #include #include #define MAXN 1005 #define ll long long bool is_prim[MAXN];//0真 int prim[MAXN]; int prim_cnt; //欧几里得 int gcd(int a,int b) { return b==0?a:gcd(b,a%b); } //拓展欧几里得 void ex原创 2014-03-15 15:24:43 · 519 阅读 · 0 评论 -
hdu 1452 Happy 2004(积性函数)
hdu 1452 Happy 2004 积性函数的运用,详解原创 2014-04-14 12:25:36 · 410 阅读 · 0 评论