This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |