s = input().split(' ')
N = int(s[0])
M = int(s[1])
querys = []
for i in range(M):
ans = input().split(' ')
A = int(ans[0]) - 1
B = int(ans[1]) - 1
C = int(ans[2])
querys.append([A, B, C])
x = [1] * N
for i in querys:
x[i[0]] = max(x[i[0]], i[2])
x[i[1]] = max(x[i[1]], i[2])
output = ''
for i in x:
output = output + str(i) + ' '
print(output)
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2732 KB |
Output is correct |
3 |
Correct |
13 ms |
2756 KB |
Output is correct |
4 |
Correct |
14 ms |
2840 KB |
Output is correct |
5 |
Correct |
13 ms |
2828 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2732 KB |
Output is correct |
3 |
Correct |
13 ms |
2756 KB |
Output is correct |
4 |
Correct |
14 ms |
2840 KB |
Output is correct |
5 |
Correct |
13 ms |
2828 KB |
Output is correct |
6 |
Correct |
44 ms |
3096 KB |
Output is correct |
7 |
Correct |
18 ms |
2964 KB |
Output is correct |
8 |
Correct |
481 ms |
3984 KB |
Output is correct |
9 |
Correct |
23 ms |
3012 KB |
Output is correct |
10 |
Correct |
345 ms |
3772 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2732 KB |
Output is correct |
3 |
Correct |
13 ms |
2756 KB |
Output is correct |
4 |
Correct |
14 ms |
2840 KB |
Output is correct |
5 |
Correct |
13 ms |
2828 KB |
Output is correct |
6 |
Correct |
44 ms |
3096 KB |
Output is correct |
7 |
Correct |
18 ms |
2964 KB |
Output is correct |
8 |
Correct |
481 ms |
3984 KB |
Output is correct |
9 |
Correct |
23 ms |
3012 KB |
Output is correct |
10 |
Correct |
345 ms |
3772 KB |
Output is correct |
11 |
Correct |
13 ms |
2888 KB |
Output is correct |
12 |
Correct |
18 ms |
3008 KB |
Output is correct |
13 |
Correct |
14 ms |
2864 KB |
Output is correct |
14 |
Correct |
15 ms |
2876 KB |
Output is correct |
15 |
Correct |
17 ms |
2904 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
114 ms |
5108 KB |
Output is correct |
2 |
Correct |
201 ms |
8628 KB |
Output is correct |
3 |
Correct |
147 ms |
7236 KB |
Output is correct |
4 |
Correct |
95 ms |
5384 KB |
Output is correct |
5 |
Correct |
31 ms |
3192 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
2840 KB |
Output is correct |
2 |
Correct |
14 ms |
2732 KB |
Output is correct |
3 |
Correct |
13 ms |
2756 KB |
Output is correct |
4 |
Correct |
14 ms |
2840 KB |
Output is correct |
5 |
Correct |
13 ms |
2828 KB |
Output is correct |
6 |
Correct |
44 ms |
3096 KB |
Output is correct |
7 |
Correct |
18 ms |
2964 KB |
Output is correct |
8 |
Correct |
481 ms |
3984 KB |
Output is correct |
9 |
Correct |
23 ms |
3012 KB |
Output is correct |
10 |
Correct |
345 ms |
3772 KB |
Output is correct |
11 |
Correct |
13 ms |
2888 KB |
Output is correct |
12 |
Correct |
18 ms |
3008 KB |
Output is correct |
13 |
Correct |
14 ms |
2864 KB |
Output is correct |
14 |
Correct |
15 ms |
2876 KB |
Output is correct |
15 |
Correct |
17 ms |
2904 KB |
Output is correct |
16 |
Correct |
114 ms |
5108 KB |
Output is correct |
17 |
Correct |
201 ms |
8628 KB |
Output is correct |
18 |
Correct |
147 ms |
7236 KB |
Output is correct |
19 |
Correct |
95 ms |
5384 KB |
Output is correct |
20 |
Correct |
31 ms |
3192 KB |
Output is correct |
21 |
Correct |
760 ms |
12308 KB |
Output is correct |
22 |
Correct |
571 ms |
13452 KB |
Output is correct |
23 |
Correct |
274 ms |
17656 KB |
Output is correct |
24 |
Execution timed out |
1064 ms |
15784 KB |
Time limit exceeded |
25 |
Halted |
0 ms |
0 KB |
- |