随笔分类 -  数论基础

1
摘要:Problem Description Farmer John keeps a website called ‘FansBlog’ .Everyday , there are many people visited this blog.One day, he find the visits has 阅读全文
posted @ 2019-07-29 17:32 black_hole6 阅读(400) 评论(0) 推荐(0)
摘要:Diophantus of Alexandria was an Egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations where variables we 阅读全文
posted @ 2019-07-24 22:24 black_hole6 阅读(220) 评论(0) 推荐(0)
摘要:Problem Description One day, Y_UME got an integer N and an interesting program which is shown below:Y_UME wants to play with this program. Firstly, he 阅读全文
posted @ 2019-07-24 20:41 black_hole6 阅读(609) 评论(2) 推荐(0)
摘要:题目描述 求关于xx的同余方程 a x \equiv 1 \pmod {b}ax≡1(modb) 的最小正整数解。 输入输出格式 输入格式: 一行,包含两个正整数 a,ba,b,用一个空格隔开。 输出格式: 一个正整数 x_0x0​,即最小正整数解。输入数据保证一定有解。 输入输出样例 输入样例#1 阅读全文
posted @ 2019-07-23 10:30 black_hole6 阅读(203) 评论(0) 推荐(0)
摘要:Problem Description Avin is studying how to synthesize data. Given an integer n, he constructs an interval using the following method: he first genera 阅读全文
posted @ 2019-07-21 15:41 black_hole6 阅读(473) 评论(2) 推荐(0)
摘要:题目描述 对于Fibonacci数列:1,1,2,3,5,8,13......大家应该很熟悉吧~~~但是现在有一个很“简单”问题:第n项和第m项的最大公约数是多少? Update:加入了一组数据。 输入输出格式 输入格式: 两个正整数n和m。(n,m<=10^9) 注意:数据很大 输出格式: Fn和 阅读全文
posted @ 2019-07-20 22:22 black_hole6 阅读(234) 评论(0) 推荐(0)
摘要:Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luck 阅读全文
posted @ 2019-05-15 23:04 black_hole6 阅读(305) 评论(0) 推荐(0)
摘要:恢复内容开始 We guessed some integer number xx. You are given a list of almost all its divisors. Almost all means that there are all divisors except 11and x 阅读全文
posted @ 2019-05-15 15:32 black_hole6 阅读(388) 评论(0) 推荐(0)
摘要:都说了别看,还看!好吧,既然点进来了,那就告诉你题意:给你一个方程,Ax+By+C=0,给你A,B,C;请找出一组解(x,y),解的要求:x是所有解中的最小正整数,y就是任意一个整数。如果存在这样的解,请给出这个解中的x;如果不存在,请输出 -1。会吗?Input ... 阅读全文
posted @ 2019-04-22 00:15 black_hole6 阅读(282) 评论(0) 推荐(0)
摘要:Bamboo Pole-vault is a massively popular sport in Xzhiland. And Master Phi-shoe is a very popular coach for his success. He needs some... 阅读全文
posted @ 2019-04-13 18:23 black_hole6 阅读(198) 评论(0) 推荐(0)
摘要:The modular modular multiplicative inverse of an integer a modulo m is an integer xsuch that a-1≡x (mod m). This is equivalent to ax≡1... 阅读全文
posted @ 2019-03-21 21:52 black_hole6 阅读(443) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/317/D来源:牛客网 题目描述小a和小b来到了一条布满了黄金的街道上。它们想要带几块黄金回去,然而这里的城管担心他们拿走的太多,于是要求小a和小b通过做一个游戏来决定最后得到的黄金的数量。... 阅读全文
posted @ 2019-01-22 20:35 black_hole6 阅读(165) 评论(0) 推荐(0)
摘要:看了一些别人的博客,发现里面涉及到的公式没有证明,于是就打算自己写一篇比较详细的讲解。先看两个引理及其证明(建议把证明搞懂)。PS:以下图片均为原作者用wps制作,如想使用请附上作者博客链接,谢谢O(∩_∩)O。 看完了上面的引理,那就可以正式开始Miller-Rab... 阅读全文
posted @ 2018-12-17 21:54 black_hole6 阅读(754) 评论(0) 推荐(0)
摘要:The greatest common divisor GCD(a,b) of two positive integers a and b,sometimes written (a,b),is the largest divisor common to a and b... 阅读全文
posted @ 2018-12-13 21:45 black_hole6 阅读(190) 评论(0) 推荐(0)
摘要:欧拉函数证明: 小于等于n的基数有n个,讨论所有n的素因子,只要是素因子的倍数的是都不是n的互质数。首先如果如果n为素数那么,φ(n)=n-1;如果n不是素数,只要除去n的质因子和n的质因子的倍数就可以了,①因为任意一个数都能表示成若干个素数的乘积,所以只要除去质因... 阅读全文
posted @ 2018-12-13 21:22 black_hole6 阅读(162) 评论(0) 推荐(0)
摘要:题目描述也许你早就知道阶乘的含义,N阶乘是由1到N相乘而产生,如:12!= 1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9 \times 10 \times 11 \t... 阅读全文
posted @ 2018-11-29 12:16 black_hole6 阅读(223) 评论(0) 推荐(0)
摘要:Diophantus of Alexandria was an egypt mathematician living in Alexandria. He was one of the first mathematicians to study equations wh... 阅读全文
posted @ 2018-11-26 20:32 black_hole6 阅读(173) 评论(0) 推荐(0)
摘要:欧拉函数 编辑在数论,对正整数n,欧拉函数是小于n的正整数中与n互质的数的数目(φ(1)=1)。此函数以其首名研究者欧拉命名(Euler's totient function),它又称为Euler's totient function、φ函数、欧拉商数等。 例如φ(8... 阅读全文
posted @ 2018-11-25 17:43 black_hole6 阅读(194) 评论(0) 推荐(0)
摘要:要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。Input数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 #include#include#includeint m... 阅读全文
posted @ 2018-11-24 12:13 black_hole6 阅读(166) 评论(0) 推荐(0)
摘要:算术基本定理,又称为正整数的唯一分解定理,即:每个大于1的自然数,若不是本身就是质数,就是可写为2个以上的质数的积,而且这些质因子按大小排列之后,写法仅有一种方式。例如:{\displaystyle 6936=2^{3}\times 3\times 17^{2}},{... 阅读全文
posted @ 2018-11-24 10:04 black_hole6 阅读(1801) 评论(0) 推荐(0)

1