Created
September 4, 2013 04:15
-
-
Save henix/6432694 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
#!/usr/bin/python2 | |
import sys | |
import re | |
records = [] | |
for line in sys.stdin: | |
records.append(re.match(r'[ ]*(\d)+ ([^ ]+)(.*)', line.rstrip()).groups()) | |
for record in sorted(records, key=lambda d:int(d[0])*(len(d[1])+len(d[2])), reverse=True): | |
print "%s %s%s" % record |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment