示例#1
0
文件: p045.py 项目: doboy/euler
from utils import triangleGen, pentagonGen, hexagonGen, argmin, equals

Z = T, P, H = triangleGen(), pentagonGen(), hexagonGen()
z = t, p, h = map( next, ( T, P, H ) )

while not equals( *z ) or z[0] in ( 1, 40755 ):
    m = argmin( *z )
    z[ m ] = next( Z[ m ] )

print z[ 0 ]

示例#2
0
文件: p012.py 项目: doboy/euler
from utils import divisors, triangleGen

for n in triangleGen():
    if len( divisors( n ) ) > 500:
        break

print n