답안 #527843

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
527843 2022-02-18T13:40:19 Z stevenkhoo2 Lost Array (NOI19_lostarray) Python 3
0 / 100
13 ms 2844 KB
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()
# 결과 실행 시간 메모리 Grader output
1 Runtime error 12 ms 2844 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 12 ms 2844 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 12 ms 2844 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 13 ms 2844 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 12 ms 2844 KB Execution failed because the return code was nonzero
2 Halted 0 ms 0 KB -