![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
欧拉函数
qq_37383726
这个作者很懒,什么都没留下…
展开
-
51nod 1136 欧拉函数 【模板 】
1136 欧拉函数 对正整数n,欧拉函数是少于或等于n的数中与n互质的数的数目。此函数以其首名研究者欧拉命名,它又称为Euler’s totient function、φ函数、欧拉商数等。例如:φ(8) = 4(Phi(8) = 4),因为1,3,5,7均和8互质。 Input 输入一个数N。(2 <= N <= 10^9) Output 输出Phi(n)。 Input示例 8 Ou原创 2017-07-21 11:16:06 · 199 阅读 · 0 评论 -
找新朋友 【欧拉】
新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。 Input 第一行是测试数据的组数CN(Case number,1#include<bits/stdc++.h> #define LL long lon原创 2017-07-21 11:30:59 · 229 阅读 · 0 评论 -
【LightOJ - 1370】 Bi-shoe and Phi-shoe 【欧拉值和素数的关系】
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 bamboos for his students, so he asked his assistant Bi-Shoe to go原创 2017-08-02 21:51:40 · 197 阅读 · 0 评论 -
Relatives 和 GCD Again 【欧拉函数】
Do you have spent some time to think and try to solve those unsolved problem after one ACM contest? No? Oh, you must do this when you want to become a “Big Cattle”. Now you will find that this prob原创 2017-08-17 11:07:19 · 243 阅读 · 0 评论 -
【HDU - 2824】- The Euler functio 【欧拉筛】
The Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprime to n, and this function has a lot of beautiful ch原创 2017-08-17 11:09:41 · 191 阅读 · 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 exc原创 2017-08-17 11:16:46 · 397 阅读 · 0 评论 -
【hdu 1695 】GCD 【容斥+欧拉 or mobius反演】
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 only原创 2017-08-01 21:13:49 · 337 阅读 · 0 评论 -
【LightOJ - 1007】Mathematically Hard 【欧拉函数筛】
Mathematically some problems look hard. But with the help of the computer, some problems can be easily solvable. In this problem, you will be given two integers a and b. You have to find the summatio...原创 2018-04-03 11:54:04 · 145 阅读 · 0 评论