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 = []
for i in range(N):
x.append(1)
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)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2780 KB |
Output is correct |
2 |
Correct |
15 ms |
2824 KB |
Output is correct |
3 |
Correct |
14 ms |
2876 KB |
Output is correct |
4 |
Correct |
16 ms |
2856 KB |
Output is correct |
5 |
Correct |
12 ms |
2840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2780 KB |
Output is correct |
2 |
Correct |
15 ms |
2824 KB |
Output is correct |
3 |
Correct |
14 ms |
2876 KB |
Output is correct |
4 |
Correct |
16 ms |
2856 KB |
Output is correct |
5 |
Correct |
12 ms |
2840 KB |
Output is correct |
6 |
Correct |
42 ms |
3156 KB |
Output is correct |
7 |
Correct |
19 ms |
2980 KB |
Output is correct |
8 |
Correct |
548 ms |
5872 KB |
Output is correct |
9 |
Correct |
24 ms |
3020 KB |
Output is correct |
10 |
Correct |
291 ms |
3844 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2780 KB |
Output is correct |
2 |
Correct |
15 ms |
2824 KB |
Output is correct |
3 |
Correct |
14 ms |
2876 KB |
Output is correct |
4 |
Correct |
16 ms |
2856 KB |
Output is correct |
5 |
Correct |
12 ms |
2840 KB |
Output is correct |
6 |
Correct |
42 ms |
3156 KB |
Output is correct |
7 |
Correct |
19 ms |
2980 KB |
Output is correct |
8 |
Correct |
548 ms |
5872 KB |
Output is correct |
9 |
Correct |
24 ms |
3020 KB |
Output is correct |
10 |
Correct |
291 ms |
3844 KB |
Output is correct |
11 |
Correct |
16 ms |
2892 KB |
Output is correct |
12 |
Correct |
18 ms |
3020 KB |
Output is correct |
13 |
Correct |
15 ms |
2764 KB |
Output is correct |
14 |
Correct |
14 ms |
2852 KB |
Output is correct |
15 |
Correct |
16 ms |
2900 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
95 ms |
5220 KB |
Output is correct |
2 |
Correct |
189 ms |
8716 KB |
Output is correct |
3 |
Correct |
147 ms |
7164 KB |
Output is correct |
4 |
Correct |
132 ms |
5444 KB |
Output is correct |
5 |
Correct |
26 ms |
3200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
2780 KB |
Output is correct |
2 |
Correct |
15 ms |
2824 KB |
Output is correct |
3 |
Correct |
14 ms |
2876 KB |
Output is correct |
4 |
Correct |
16 ms |
2856 KB |
Output is correct |
5 |
Correct |
12 ms |
2840 KB |
Output is correct |
6 |
Correct |
42 ms |
3156 KB |
Output is correct |
7 |
Correct |
19 ms |
2980 KB |
Output is correct |
8 |
Correct |
548 ms |
5872 KB |
Output is correct |
9 |
Correct |
24 ms |
3020 KB |
Output is correct |
10 |
Correct |
291 ms |
3844 KB |
Output is correct |
11 |
Correct |
16 ms |
2892 KB |
Output is correct |
12 |
Correct |
18 ms |
3020 KB |
Output is correct |
13 |
Correct |
15 ms |
2764 KB |
Output is correct |
14 |
Correct |
14 ms |
2852 KB |
Output is correct |
15 |
Correct |
16 ms |
2900 KB |
Output is correct |
16 |
Correct |
95 ms |
5220 KB |
Output is correct |
17 |
Correct |
189 ms |
8716 KB |
Output is correct |
18 |
Correct |
147 ms |
7164 KB |
Output is correct |
19 |
Correct |
132 ms |
5444 KB |
Output is correct |
20 |
Correct |
26 ms |
3200 KB |
Output is correct |
21 |
Correct |
750 ms |
12168 KB |
Output is correct |
22 |
Correct |
641 ms |
13992 KB |
Output is correct |
23 |
Correct |
261 ms |
16344 KB |
Output is correct |
24 |
Execution timed out |
1095 ms |
14868 KB |
Time limit exceeded |
25 |
Halted |
0 ms |
0 KB |
- |