![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
欧拉函数
mmk27
这个作者很懒,什么都没留下…
展开
-
HDU - 1695 容斥+欧拉函数
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're...原创 2018-10-31 13:02:15 · 118 阅读 · 0 评论 -
POJ - 2154 Color polya定理+欧拉
题目链接:点击查看 题意:n个项链的环,可以涂n种颜色,供有多少种方案 题解: 这里的m==n,所以结果问哦 phi(n / i) * n^(i - 1) (n%i==0) #include<iostream> #include<cstdio> #include<algorithm> using namespace std; typedef long ...原创 2019-03-18 16:09:31 · 157 阅读 · 0 评论 -
1040 最大公约数之和 欧拉函数
题目链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1040 题意:给出一个n,求1-n这n个数,同n的最大公约数的和。比如:n = 6 1,2,3,4,5,6 同6的最大公约数分别为1,2,3,2,1,6,加在一起 = 15 题解:枚举他的因子p,gcd为p时的种类数为(n / p) 的欧拉函数 #include&l...原创 2019-06-25 15:55:04 · 201 阅读 · 0 评论