Submission #527843

#TimeUsernameProblemLanguageResultExecution timeMemory
527843stevenkhoo2Lost Array (NOI19_lostarray)Cpython 3
0 / 100
13 ms2844 KiB
f1 = open('input.txt') for i in f1: i = i.strip().split() N = int( i[0] ) M = int( i[1] ) break result = [] for i in range(N): result.append(0) criteria = [] for i in f1: i = i.strip().split() criterionline = (int(i[0]), int(i[1]), int(i[2])) criteria.append( criterionline ) for i in criteria: if result[ i[0]-1 ] < i[2]: result[ i[0]-1 ] = i[2] if result[ i[1]-1 ] < i[2]: result[ i[1]-1 ] = i[2] f2 = open('output.txt','w') result_text = '' for i in result: result_text = result_text + str(i) + ' ' f2.write(result_text.strip()) f1.close() f2.close()
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...