- 博客(26)
- 收藏
- 关注
原创 Python-Project Euler 83
a=[[0 for i in range(85)]for j in range(85)]dp=[[999999999 for i in range(85)]for j in range(85)]vis=[[0 for i in range(85)]for j in range(85)]tot=0list=[]Mini=-1Minj=-1Min=99999
2014-01-22 03:05:31
463
原创 Python-Project Euler 82
file=open('e:\\matrix.txt')f=file.read()s=f.split('\n')s.pop()a=[[0 for i in range(85)]for j in range(85)]dp=[[0 for i in range(85)]for j in range(85)]vis=[[0 for i in range(85)]for j
2014-01-22 00:15:06
483
原创 Python-Project Euler 81
def min(a,b): if a return a else: return bfile=open('e:\\matrix.txt')f=file.read()s=f.split('\n')s.pop()a=[[0 for i in range(85)]for j in range(85)]
2014-01-21 22:49:20
414
原创 Python-Project Euler 67
def max(a,b): if a>b: return a else: return b a=[[0 for i in range(110)] for j in range(110)]dp=[[0 for i in range(110)] for j in range(110)]file=open(
2014-01-21 14:13:09
439
原创 Python-Project Euler 56
def calc(x): sum=0 while x>0: sum+=(x%10) x//=10 return sumbigest=-1for a in range(1,100): for b in range(100): tp=calc(a**b) if tp>
2014-01-20 17:52:38
381
原创 Python-Project Euler 52
f=[]def cl(x): global f f=[] while x>0: s=x%10 if s not in f: f.append(s) x//=10def check(x): global f while x>0:
2014-01-20 17:48:06
409
原创 Python-Project Euler 50
from selectPrime import *from isPrime import *prime=[1]*1000005f=[]selectPrime(1000000,prime,f)sum=[0]*100000sum[1]=f[0]for i in range(len(f)): sum[i+1]=sum[i]+f[i]
2014-01-20 17:42:25
369
原创 Python-Project Euler 48
sum=0for i in range(1,1001): sum+=(i**i)sum=str(sum)print(sum[len(sum)-10:])
2014-01-20 00:30:03
419
原创 Python-Project Euler 46
from isPrime import *from math import sqrtf=[]for i in range(100000): if isPrime(i): f.append(i)for i in range(5,100000,2): x=i if isPrime(x): continue
2014-01-19 18:59:26
341
原创 Python-Project Euler 45
from math import *for i in range(100000): x=i*(i+1)//2 a=(1+sqrt(1+24*x))/6 b=(1+sqrt(1+8*x))/4 if (a==int(a))and(b==int(b)): print(x,' * ',i,' ',a,' ',b)
2014-01-19 14:39:38
416
原创 Python-Project Euler 43
f=[]sum=0def check(): global f ma=[0,2,3,5,7,11,13,17] for i in range(1,8): s='' s+=str(f[i]) s+=str(f[i+1]) s+=str(f[i+2]) x=int(s)
2014-01-18 22:28:40
361
原创 Python-Project Euler 42
from math import *file=open("e:\\words.txt")def make(x): sum=0 for i in range(len(x)): sum+=(ord(x[i])-ord('A')+1) return sums=file.read()f=s.split(',')to
2014-01-18 21:15:55
431
原创 Python-Project Euler 41
from isPrime import *ans=[]f=[]def check(): global f s='' for i in range(len(f)): s+=str(f[i]) if isPrime(s)==True: return True else:
2014-01-18 16:35:02
368
原创 Python-Project Euler 40
x=''for i in range(1,10000000): if len(x)>1000005: break x+=str(i)print(len(x))l=int(x[0])*int(x[9])*int(x[99])*int(x[999])*int(x[9999])*int(x[99999])*\ int(x[999999]
2014-01-18 16:00:32
430
原创 Python-Project Euler 39
tot=-1l=-1for p in range(4,1001): sum=0 for a in range(1,p): for b in range(a,p): c=p-a-b if (c break if a*a+b*b==c*c
2014-01-18 15:56:19
334
原创 Python-Project Euler 38
from isPandigital import *max=-1for i in range(500000): s='' for j in range(1,10): s+=str(i*j) if (isPandigital(s)==True and j>1): print(i,' ',s)
2014-01-18 15:40:23
397
原创 Python-Project Euler 37
from isPrime import *sum=0def go(x): t=str(x) s='' for i in range(len(t)): s+=t[i] if isPrime(s)==False: return False for i in range(len(
2014-01-18 15:12:47
498
原创 Python-Project Euler 36
def check(x): tp=str(x) for i in range(len(tp)//2): if tp[i]!=tp[len(tp)-1-i]: return False return Truedef binary(x): f=[] t=x while(t>0):
2014-01-18 14:02:03
459
原创 Python-Project Euler 32
from math import *sum=0def check(x,m1,m2): f=[] a=str(x) b=str(m1) c=str(m2) for i in range(len(a)): if a[i]=='0': return False
2014-01-18 11:53:27
373
原创 Python-Project Euler 31
v=[1,2,5,10,20,50,100,200]f=[[0 for i in range(205)] for j in range(10)] for i in range(8): for j in range(201): if i==0: f[i][j]=1 continue f
2014-01-18 11:30:19
481
原创 Python-Project Euler 30
sum=0for i in range(2,3000000): x=0 tp=i while(tp>0): s=tp%10 x+=(s**5) tp=tp//10 if i==x: sum+=xprint(sum)
2014-01-18 00:23:32
383
原创 Python-Project Euler 29
f=[]for a in range(2,101): for b in range(2,101): x=a**b if x not in f: f.append(x)print(len(f))
2014-01-18 00:17:00
355
原创 Python-Project Euler 27
from isPrime import *max=-1product=0for a in range(-999,1000): for b in range(-999,1000): n=0 while(n*n+a*n+b>2 and isPrime(n*n+a*n+b)==True): n+=1
2014-01-17 23:54:50
363
原创 Python-Project Euler 26
max=-1d=0for i in range(2,1000): f=[] x=[1,i] while x not in f: f.append(x) a=x[0]*10 b=x[1] t=[] t.append(a%b) t.append(b)
2014-01-17 23:35:35
458
原创 Python-Project Euler 24
total=0f=[]vis=[]def go(k): #第k位,总共有10位 if k>10: global total total+=1 if total==1000000: print(f) return return if t
2014-01-17 22:43:00
405
原创 Python-Project Euler 22
file=open("e:\\names.txt")x=file.read();sum=0dic={'A':1,'B':2,'C':3,'D':4,'E':5,'F':6,'G':7,'H':8,'I':9,'J':10,'K':11,'L':12,\ 'M':13,'N':14,'O':15,'P':16,'Q':17,'R':18,'S':19,'T':20,'
2014-01-17 12:58:36
428
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人