예제 #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