
欧拉函数
菜圾
Hi, it's your Accepted !
展开
-
HDU 6265 - 2017 China Collegiate Programming Contest, Hangzhou - B.Master of Phi -(欧拉函数,公式化简)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6265题意:已知欧拉函数为φ(n),有公式如下:其中p是n的所有互不相同的素因子。然后给出n,求如下函数:其中n是以分解质因子的形式给出,即对于n=p1^q1*p2^q2...*pm^qm,题目先给出m,再接着m行每行给出pi,qi。解析:对于给出的n,d的每个因子,将其带入公式...原创 2018-10-18 00:24:26 · 259 阅读 · 2 评论 -
(HDU6390)2018 Multi-University Training Contest 7 - 1005 - GuGuFishtion - 欧拉函数
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6390题意:Gu(a,b)=phi(a*b)/(phi(a)*phi(b)),给出n,m,p求(∑a=1 to m ∑b=1 to n Gu(a,b)) (modp);解析:来自dls直播首先欧拉函数求解公式如下: 考虑a和b中的某个质因子p,假设p在a中有p^a1、p在b中有p^b1、...原创 2018-08-14 21:23:23 · 309 阅读 · 0 评论 -
POJ2154(Pólya定理与欧拉函数优化)
不错的Polya题目,有两篇博客给了两个不同的思路,但最终公式都相同代码也相同 题意:给出两个整数n和p,代表n个珠子,n种颜色,要求不同的项链数,翻转置换不考虑。结果模p.题解: 基本知识:共有n种置换(都是旋转置换),每种置换循环节的个数为gcd(n , i) , 对应循环节长度为L=n / gcd(n , i)(旋转置换中的所有循环节的长度相同)其中i为转的位置数。 普...转载 2018-01-30 10:33:25 · 305 阅读 · 0 评论 -
POJ - 2154 Color - (Ploya定理,欧拉函数,1~n的gcd(n,i)之和)
DescriptionBeads of N colors are connected together into a circular necklace of N beads (N<=1000000000). Your job is to calculate how many different kinds of the necklace can be produced. You ...原创 2018-01-08 22:04:05 · 599 阅读 · 0 评论 -
HDU - 1695 - GCD - (容斥定理,欧拉函数)
Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very large, you...原创 2017-12-10 17:05:53 · 336 阅读 · 0 评论 -
hdu - 2588 - GCD(欧拉函数求同值gcd个数)
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,For example,(1,2)=1,(12,18)=6. (a,b) can be easily found by t...原创 2017-11-19 20:34:03 · 401 阅读 · 0 评论 -
hdu - 3501 - Calculation 2-(欧拉函数求互质数的和)
Given a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said to be coprime to B if A, B share no common positive divisors...原创 2017-11-19 17:00:43 · 483 阅读 · 0 评论 -
poj - 1284 - Primitive Roots - (欧拉函数求原根)
We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (x i mod p) | 1 <= i <= p-1 } is equal to { 1, ..., p-1 }. For example, the consecutive...原创 2017-11-15 12:52:37 · 314 阅读 · 0 评论 -
uva-10299-Relatives-(欧拉函数)
Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such t...原创 2017-11-11 17:30:02 · 359 阅读 · 0 评论