, :
sorted_files=[]
strings=[]
for i in xrange(files+1):
sorted_files.append(open("temp"+str(i)+"-sorted.txt","r"))
strings.append(sorted_files[i].readline())
print len(sorted_files)
print strings
eofs=0
while eofs != 1:
small_str=min(filter(lambda x: x != "", strings))
str_index=strings.index(small_str)
of.write(small_str)
strings[str_index]=sorted_files[str_index].readline()
if all(i =="" for i in strings):
eofs=1
6,5 (~ 700), 500000 , , ( ) , , 128 ( 2- , ), 16 :
real 15m54.375s
user 15m52.096s
sys 0m3.000s
script , , , , . , .