随笔分类 -  算法

摘要:参考了http://www.cnblogs.com/zhouyinhui/archive/2011/01/27/1945911.html。notes:维基一下:http://en.wikipedia.org/wiki/Pythagorean_triple(在维基这方面,国人发现手机网络比家里宽带更能正常显式?)发现构造毕达哥拉斯三元组的方法有很多(值得注意的是,有些方法是构造“原毕达哥拉斯三元组primitive Pythagorean triple (PPT)”的,由PPT可以构造出其他三元组),其中一种方法是这样的:取任意的正整数m, n (m>n)a = m^2 - n^2b = 阅读全文

posted @ 2011-03-06 15:28 道明一腾 阅读(106) 评论(0) 推荐(0) 编辑 |

摘要:[Project Euler] 来做欧拉项目练习题吧: 题目002 周银辉来看看第二题吧问题描述:Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...By considering the terms in the Fibonacci sequence whose values do not ex 阅读全文

posted @ 2011-03-03 10:40 道明一腾 阅读(127) 评论(0) 推荐(0) 编辑 |

摘要:[Project Euler] 欧拉项目练习题001 周银辉关于Project Euler的一点介绍:哈哈,两个月没更新博客了,因为跑去做Project Euler上的练习题了,非常非常乐意向大家推荐这个网站:http://projecteuler.net/上面有很多题,由浅入深,基本上是由数学与计算机程序相结合来解决问题,非常有意思。另外建议大家在编程时选用C语言,以及尽量不要用库函数(malloc之类少数函数还是必须得使用的)以更好地提高自己的编程能力。当然肯定会有同学会提ACM之类的,恩,萝卜白菜各有所爱啦,反正我更爱Project Euler. 还有就是要持之以恒,我看了下,有十多万注 阅读全文

posted @ 2011-03-03 10:27 道明一腾 阅读(260) 评论(0) 推荐(0) 编辑 |

摘要:[Project Euler] 来做欧拉项目练习题吧: 题目005 周银辉问题描述:2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?(先思考,如果有兴趣先编程试试,然后才看下面的内容)问题分析:求能被1到20的数整除的最小正整数。最直觉的方法 阅读全文

posted @ 2011-03-03 10:08 道明一腾 阅读(198) 评论(0) 推荐(0) 编辑 |

Copyright © 2024 道明一腾
Powered by .NET 8.0 on Kubernetes