# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
526517 | bebecanvas | Lost Array (NOI19_lostarray) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
s = input().split(' ')
N = int(s[0])
M = int(s[1])
x = [0] * N
for i in range(M):
ans = input().split(' ')
A = int(ans[0]) - 1
B = int(ans[1]) - 1
C = int(ans[2])
x[A] = max(x[A], C)
x[B] = max(x[B], C)
output = ''
for i in x:
output = output + str(i) + ' '
print(output)