自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 python processing的老家,google半天没搜到,群友藏了,记这儿

http://developer.berlios.de/project/showfiles.php?group_id=9001&release_id=14497在2.6以前,必须下载安装.windows有EXE的执行安装包.对*NIX系统有源文件安装包.据说2.6已经自带这个模块了.不过我还暂时没有安装2.6.谢谢lvs

2008-11-25 15:25:00 1601

原创 昨晚,奔奔第一次哭伤心了。。。

因为学步车的问题,奔奔坐了学步车从客厅往厨房冲,地板上有一步半手掌宽度左右的落差,以前也安全降落过,但这次,忽的一歪,人就从学步车里倒腾了出来,左边脸先着地。据老婆讲,着地时,他还下意识地用手在前面护了一下。不过仍然左前额爆出来一个青包,哭很非常伤心。这是第一次如此使力地哭,哭得回肠荡气,哭得万分委屈,哭得老婆在旁边跟着泪珠在眼框里打转。我回家时,已经哭了好几分钟了,弄清事情后,我也真心抱过来哄他

2008-11-19 15:53:00 1373

原创 projecteuler.net解题记录,参考了肥猫的(第14题)

第14题:Find the longest sequence using a starting number under one million.根据数学家猜想,对一个任意自然数循环进行如下处理,最后总可以得到1:如果是偶数: 除以2否则:乘以3再加上1找出100万以内,拥有最大步数的自然数。mark = [0] * 1000000mark[1] = 1def collatz(n):    m =

2008-11-19 15:36:00 1638

原创 projecteuler.net解题记录,参考了肥猫的(第13题)

 第13题:Work out the first ten digits of the sum of the following one-hundred 50-digit numbers.求100个50位数的和的前10位。这个用python解决就太简单了,因为python内置了超大整数类型,直接加起来,转字符串,取前10位。不过设想一下,对于不支持超大整数类型的语言来解决的话,肯定是每把个50位数字

2008-11-18 11:43:00 1499

原创 算法的逐步优化:100匹马拉100包货的问题

回复的python列表里的一个讨论====问题的提出====peng cao reply-to python-cn@googlegroups.comto python-cn@googlegroups.comdate Sun, Nov 16, 2008 at 13:48subject [CPyUG:71453] 想问个初级问题!有这样一道题目:100匹马

2008-11-18 11:27:00 2297

原创 projecteuler.net解题记录,参考了肥猫的(第12题)

 第12题:What is the value of the first triangle number to have over five hundred divisors?找出第一个拥有500个因数的1-n连续自然数之和.分析:相邻两个自然数没有公约数,其乘积的因数数量,等于两个数各自的因数数量之积.# -*- coding: gb2312 -*-# 找出第1个拥有500个因数的1-n的自然数

2008-11-07 11:20:00 1542

原创 projecteuler.net解题记录,参考了肥猫的(第11题)

第11题:What is the greatest product of four numbers on the same straight line in the 20 by 20 grid?找出20*20方阵中,在同一直线或斜线上相邻4数之积的最大者.d = []for i in xrange(20):    d.append( [ int(j) for j in s.splitlines()

2008-11-07 10:24:00 1520

原创 秀一下我的儿

5个多月的时候,用自家的Z700拍的.挺调皮吧?

2008-11-03 14:11:00 1366

原创 projecteuler.net解题记录,参考了肥猫的(第10题)

 第10题:Calculate the sum of all the primes below two million.求2百万以内的质数的和.start = time.time()s = 2value = 3print s,value,lenghtmarked = [1] * lenghtwhile value     if marked[value]:        s += value   

2008-11-03 11:24:00 1493

原创 projecteuler.net解题记录,参考了肥猫的(第9题)

第9题:Find the only Pythagorean triplet, {a, b, c}, for which a + b+ c = 1000.求出某三个数,满足a**2+b**2==c**2,且a+b+c=1000# a+b+c = 1000, 同时满足 a平方加b平方等于c平方import timestart = time.time()def test():    for a in x

2008-11-03 10:52:00 1644

原创 projecteuler.net解题记录,参考了肥猫的(8题)

第8题:Discover the largest product of five consecutive digits in the 1000-digit number.s = 指定数字串print max( [ eval(*.join(s[i:i+5])) for i in xrange(len(s)-5) ] 这个算法个人认为没有优化的必要,在s串不是很长,或连续数字不是很多的情况下.

2008-10-26 12:03:00 1500

原创 projecteuler.net解题记录,参考了肥猫的(7题)

第4题:Find the 10001st prime.找出第10001个质数# -*- coding: gb2312 -*-# 找出第10001个质数import mathimport timestart = time.time()value, s, i = 3, 2, 1max = 2000000t0 = int(math.sqrt(max))+1market = [1] * max#while

2008-10-26 11:55:00 1656

原创 projecteuler.net解题记录,参考了肥猫的(4-6题)

第四题:Find the largest palindrome made from the product of two 3-digit numbers.找出能够分解为两个三位数相乘的最大荷花数# -*- coding: gb2312 -*-def palind(n):    """判断一个数是否荷花数"""    str_num = list(str(n))    str_num.reverse

2008-10-25 13:50:00 1636

原创 projecteuler.net解题记录,参考了肥猫的(1-3题)

一个很有意思的解题网站.我主要用python来解决.第一题:Add all the natural numbers below one thousand that are multiples of 3 or 5.求1000以下的能被3或5整除的整数之和.>>> sum([i for i in xrange(1000) if not i%3 or not i%5])233168第二题:Find th

2008-10-25 12:04:00 1725

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除