![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
欧拉函数
文章平均质量分 68
h1021456873
这个作者很懒,什么都没留下…
展开
-
HDU 1539 2^x mod n = 1 (欧拉函数)
Problem DescriptionGive a number n, find the minimum x(x>0) that satisfies 2^x mod n = 1.InputOne positive integer on each line, the value of n.OutputIf the minimum x exists, p原创 2016-01-28 14:01:09 · 438 阅读 · 0 评论 -
HDU 1286 找新朋友 (欧拉函数_打表)
Problem Description新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input第一行是测试数据的组数CN(Case number,1Output对原创 2016-01-28 14:44:43 · 359 阅读 · 0 评论 -
HDU The Euler function (欧拉函数打表)
Problem DescriptionThe 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 h原创 2016-01-28 15:04:40 · 455 阅读 · 0 评论 -
欧拉函数(模板)
//直接求解欧拉函数int euler(int n){ //返回euler(n) int res=n,a=n; for(int i=2;i*i<=a;i++){ if(a%i==0){ res=res/i*(i-1);//先进行除法是为了防止中间数据的溢出 while(a%i==0) a/=i;原创 2016-01-28 15:03:38 · 705 阅读 · 0 评论 -
HDU 3501 Calculation 2 (欧拉函数)
小于等于n,且与n互质的因子sum= euler(n)*n/2Problem DescriptionGiven 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原创 2016-01-28 16:48:23 · 351 阅读 · 0 评论 -
HDU 1787 GCD Again (欧拉函数)
Problem DescriptionDo 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 wi原创 2016-01-28 21:50:48 · 435 阅读 · 0 评论 -
codeforces 723e One-Way Reform (欧拉回路) || 欧拉回路路径输出模板
There are n cities and m two-way roads in Berland, each road connects two cities. It is known that there is no more than one road connecting each pair of cities, and there is no road which connects原创 2016-11-29 20:01:37 · 367 阅读 · 0 评论