Skip to content

Instantly share code, notes, and snippets.

@jakedobkin
Created January 1, 2012 00:18
Show Gist options
  • Save jakedobkin/1545738 to your computer and use it in GitHub Desktop.
Save jakedobkin/1545738 to your computer and use it in GitHub Desktop.
# http://projecteuler.net/problem=99
from math import log
file = open('base_exp.txt','r').readlines()
# i thought maybe if we worked the box in two sections- from the top down and from the bottom up
# meeting in the middle, where the target cell was- but this doesn't appear to work either
array = []
for i in range (0,len(file)):
line = file[i][:-2].split(',')
line[0] = int(line[0])
line[1] = int(line[1])
array.append(line)
# this next line corrects cutting of the end of the last line
array[999][1]=725685
print array
max = 0
max_x = 0
for x in range (0,len(array)):
a = array[x][1]*log(array[x][0])
if a > max:
max = a
max_x = x+1
print max_x,a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment