![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Project Euler
sosidami
这个作者很懒,什么都没留下…
展开
-
Project Euler Problem 81
很显然是一个动态规划的题目,也可以建模为一个有向图,然后用Dijkstra算法寻找最短路径。 具体的实现(C++)可以从右下依次向上做遍历,看到很多人用了递归,纵然不用考虑下标的转换,但效率很低,写的不好让人很不爽。。 Answer:427337原创 2009-10-23 21:54:00 · 486 阅读 · 0 评论 -
Project Euler Problem 14
很简单的一个题目,纯粹暴力解决。而且现在已经证明了此问题不可描述。。。 public class PE14 { /** * @param args */ public static int p14(long n) { int count = 0; while (n != 1) { if (n % 2 ==原创 2010-01-04 09:10:00 · 744 阅读 · 0 评论 -
Project Euler Problem 15
组合中一个基本问题--->C(40,20)import java.math.*;public class PE15 { /** * @param args */ private static BigInteger combination(int total, int selection) { selection = selection >原创 2010-01-04 09:34:00 · 668 阅读 · 0 评论 -
Project Euler Problem 16
/*div_tStructure used to represent the value of an integral division performed by div.It has two members of the same type, defined in either order as:int quot; int rem; Members:quot原创 2009-12-30 16:48:00 · 503 阅读 · 0 评论 -
Project Euler Problem 32
//很easy的推理得到一定是1*4=4或者3*2=4之类的。(数字代表数的位数)#include #include #include #include unsigned int f(void){ typedef std::set res_set; res_set res; unsigned int digits[9]; unsigned int n1,原创 2009-12-30 18:17:00 · 557 阅读 · 0 评论 -
Project Euler Problem 31
#include using namespace std;int Pound[]={200,100,50,20,10,5,2,1};int count=0;void Solve(int index, int value){ if(value==0||index==7) { count++; return ; } for(int i=0;i<=valu原创 2009-12-30 17:37:00 · 618 阅读 · 0 评论 -
Project Euler Problem 30
太没技术含量了,不可能存在7位及七位数以上的答案,枚举即可获得解答!Answer:443839原创 2009-12-30 17:02:00 · 513 阅读 · 0 评论 -
Project Euler Problem 25
有数学方法的一定不用程序方法!!用差分找到斐波那契数列的通项公式,然后列不等式求解=CEILING( (1000 - 1 + LOG10(SQRT(5))) / LOG10((1+SQRT(5))/2),1)这个题目可以扩展一下任意前n位的情况呢。。这个题目可以扩展成为一个acm题目,当然标准解法就是求出通项公式,然后求解原创 2010-02-19 11:39:00 · 567 阅读 · 0 评论 -
Project Euler Problem 59
Project Euler Problem 59 我真的很崩溃。。The Gospel of John ,Chapter 1.. 密钥是god... 暴力算吧。。看到大家好多人都在找the。。恩,这个主意不错。。 Answer:107359原创 2009-10-24 18:11:00 · 792 阅读 · 0 评论 -
Project Euler Problem 60
Project Euler Problem 60 两种思路都是枚举,不过处理细节有些不同。 假设:题目中描述的关系,我们称之为关系P,两个素数满足关系P。 我们已经生成一个素数表。其中存放着从小到大的很多素数。第一种思路: 1 我们为每一个素数,生成一个链表,链表中从小到大存放与表头元素满足关系P的素数。 2 任何两个链表只要非表头元素部分存在相投元素,那么原创 2009-10-24 17:18:00 · 849 阅读 · 0 评论 -
Project Euler Problem 58
Project Euler Problem 58 很easy的一个问题,只要找到对角线规律就可以了 Answer: 26241原创 2009-10-24 20:01:00 · 767 阅读 · 0 评论 -
Project Euler Problem 57
Project Euler Problem 57 这个要深入研究一下。。。。我是暴力写的。。太对不起人了。。。以后再改。。。最近也在看连分数。。但是还是太囧。。下面是在论坛讨论上大家的讨论。。以后再整理。。感觉还是遇到大牛了。。。。 巨牛的一个人用汇编写的代码,这个让我意识到,你真的很强悍!! .data? sumof dd原创 2009-10-24 20:38:00 · 622 阅读 · 0 评论 -
Project Euler Problem 17
非常无聊的一个题目!import java.math.*;public class PE15 { /** * @param args */ private static int[] singleWord = { 4, 3, 3, 5, 4, 4, 3, 5, 5, 4, 3, 6, 6, 8, 8, 7, 7, 9, 8, 8 }; privat原创 2010-01-04 09:49:00 · 668 阅读 · 0 评论