問題はこれです:私はそれを解決しようとしました、そして私もそうしたと思います、しかし私が評価のためにそれを郵送したときそれは言います
We have tested your solution, and while doing so we unfortunately
discovered the following error:
Run Time Error
Exited with error status 1
これが私のコードです:
import re
import sys
def fun():
for ind in ratio:
max_num = ratio_list[0]
if ratio[ind] == max_num:
print ind
ratio_list.remove(ratio_list[0])
hits = []
song = []
n,m = raw_input().split(' ',1)
for i in range(0,int(n)):
h,n = raw_input().split(" ",1)
is_number = isinstance( int(h), int )
is_string = len(n)<=30 and bool(re.match('[a-z_0-9]+$', n))
if not(is_number and is_string):
sys.exit("Error");
hits.append(int(h))
song.append(n)
ratio = {}
ratio_list = []
f_of_i = hits[0]
counter = 1
index = 0
for hit in hits:
ratio_list.append(hit*counter)
ratio[song[index]] = hit*counter
index = index +1
counter = counter +1
ratio_list.sort()
ratio_list.reverse()
for j in range(0,int(m)):
fun()
私は何を間違っているのですか?なぜ解決策が受け入れられないのか、私は興味があります。