Last active
December 24, 2015 19:39
-
-
Save spellancer/6852084 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fr = open('input.txt','r') | |
fw = open('output.txt','w') | |
line = fr.readline() | |
a = [] | |
i=0 | |
while len(line)!=0: | |
line = fr.readline() | |
i+=1 | |
line = line.split() | |
if len(line)!=0: | |
line[2]=line[2].split('%')[0] | |
a.append([i,float(line[2]),float(line[5]),float(line[8])]) | |
a.sort (key=lambda x:([1],x[3],x[2]), reverse=True) | |
fw.write (str(a[0][0])) | |
fr.close() | |
fw.close() |
a.sort (key=lambda x:(!!!x!!!!!!![1],x[3],x[2]), reverse=True)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
while True:
line = fr.readline()
if not line:
break
line = line.split()
print line