码迷,mamicode.com
首页 >  
搜索关键字:euler    ( 502个结果
仪仗队(欧拉函数模板)
1 long long euler_phi(int n) 2 { 3 int m=(int)sqrt(n+0.5); 4 int ans=n; 5 for(int i=2;i1)ans=ans/n*(n-1);14 return ans;15 }Descriptio...
分类:其他好文   时间:2015-07-19 20:03:03    阅读次数:137
Project Euler:Problem 78 Coin partitions
Let p(n) represent the number of different ways in which n coins can be separated into piles. For example, five coins can be separated into piles in exactly seven different ways, so p(5)=7. ...
分类:其他好文   时间:2015-07-19 16:35:22    阅读次数:181
Project Euler:Problem 76 Counting summations
It is possible to write five as a sum in exactly six different ways: 4 + 1 3 + 2 3 + 1 + 1 2 + 2 + 1 2 + 1 + 1 + 1 1 + 1 + 1 + 1 + 1 How many different ways can one hundred be written as a su...
分类:其他好文   时间:2015-07-18 18:41:52    阅读次数:94
Project Euler:Problem 77 Prime summations
It is possible to write ten as the sum of primes in exactly five different ways: 7 + 3 5 + 5 5 + 3 + 2 3 + 3 + 2 + 2 2 + 2 + 2 + 2 + 2 What is the first value which can be written as the sum o...
分类:其他好文   时间:2015-07-18 18:40:05    阅读次数:118
UVA 10735 Euler Circuit 混合图的欧拉回路(最大流,fluery算法)
题意:给一个图,图中有部分是向边,部分是无向边,要求判断是否存在欧拉回路,若存在,输出路径。分析:欧拉回路的定义是,从某个点出发,每条边经过一次之后恰好回到出发点。 无向边同样只能走一次,只是不限制方向而已,那么这个情况下就不能拆边。不妨先按照所给的start和end的顺序,初步定下该无向边的顺序....
分类:编程语言   时间:2015-07-18 12:19:48    阅读次数:428
Project Euler:Problem 74 Digit factorial chains
The number 145 is well known for the property that the sum of the factorial of its digits is equal to 145: 1! + 4! + 5! = 1 + 24 + 120 = 145 Perhaps less well known is 169, in that it produces the...
分类:其他好文   时间:2015-07-17 22:49:49    阅读次数:132
Project Euler:Problem 71 Ordered fractions
Consider the fraction, n/d, where n and d are positive integers. If nd and HCF(n,d)=1, it is called a reduced proper fraction. If we list the set of reduced proper fractions for d ≤ 8 in ascending or...
分类:其他好文   时间:2015-07-17 16:26:05    阅读次数:130
Project Euler:Problem 72 Counting fractions
Consider the fraction, n/d, where n and d are positive integers. If nd and HCF(n,d)=1, it is called a reduced proper fraction. If we list the set of reduced proper fractions for d ≤ 8 in ascending or...
分类:其他好文   时间:2015-07-17 16:24:15    阅读次数:121
Project Euler:Problem 70 Totient permutation
Euler's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of positive numbers less than or equal to n which are relatively prime to n. For example, as 1, 2,...
分类:其他好文   时间:2015-07-17 14:04:42    阅读次数:142
Project Euler:Problem 68 Magic 5-gon ring
Consider the following "magic" 3-gon ring, filled with the numbers 1 to 6, and each line adding to nine. Working clockwise, and starting from the group of three with the numerically lowest exte...
分类:其他好文   时间:2015-07-17 10:06:11    阅读次数:231
502条   上一页 1 ... 32 33 34 35 36 ... 51 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!