
欧拉定理&广义欧拉定理
小天位
这个作者很懒,什么都没留下…
展开
-
hdu1395 2^x mod n = 1
题意:输入一个整数n,是否存在一个最小整数的x,使得2^x mod n=1,输出格式看原题。 逆元. 1.当n为偶数的时候无解,因为gcd(2,n)!=1,既然不互质,哪来的逆元 (注意边界n=1 也无解(任何数和1求逆元都不存在)) 2.n为奇数的时候gcd(2,n)=1(附文),所以欧拉函数、 3.因为是要求最小的幂次x,很显然得用欧拉函数的因子来降幂搞定 ...原创 2018-10-29 18:01:12 · 139 阅读 · 0 评论 -
hdu2588 GCD
题意:Given integers N and M, how many integer X satisfies 1<=X<=N and (X,N)>=M. 0.d=gcd(x,n) >= m d是x,n的公共的最大公约数、 1.找到n的因数(p)>=m gcd(x,n)=p 2.=> gcd(x/p,n/p) = 1 3...原创 2018-10-29 19:17:48 · 234 阅读 · 0 评论 -
【HDU 2814 扩展欧拉 a^b ≡ (a mod c)^b mod ϕ(c)+ϕ(c) modc,b>=ϕ(c) 】
G(1)=F(ab)G(1)=F(ab) G(n)=G(n−1)F(ab)(n>=2)G(n)=G(n−1)F(ab)(n>=2) 求G(n)modc 具体: In mathematics, the Fibonacci numbers are a sequence of numbers named after Leonardo of Pisa, known as Fibonacci ...原创 2018-12-02 06:48:43 · 238 阅读 · 0 评论