s = input().split(' ')
N = int(s[0])
M = int(s[1])
x = [1] * N
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[A] = max(x[A], C)
x[B] = max(x[B], C)
output = ''
for i in x:
output = output + str(i) + ' '
print(output)
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
2844 KB |
Output is correct |
2 |
Correct |
13 ms |
2764 KB |
Output is correct |
3 |
Correct |
14 ms |
2764 KB |
Output is correct |
4 |
Correct |
13 ms |
2764 KB |
Output is correct |
5 |
Correct |
12 ms |
2764 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
2844 KB |
Output is correct |
2 |
Correct |
13 ms |
2764 KB |
Output is correct |
3 |
Correct |
14 ms |
2764 KB |
Output is correct |
4 |
Correct |
13 ms |
2764 KB |
Output is correct |
5 |
Correct |
12 ms |
2764 KB |
Output is correct |
6 |
Correct |
40 ms |
3120 KB |
Output is correct |
7 |
Correct |
17 ms |
2944 KB |
Output is correct |
8 |
Correct |
552 ms |
5568 KB |
Output is correct |
9 |
Correct |
22 ms |
3020 KB |
Output is correct |
10 |
Correct |
270 ms |
3748 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
2844 KB |
Output is correct |
2 |
Correct |
13 ms |
2764 KB |
Output is correct |
3 |
Correct |
14 ms |
2764 KB |
Output is correct |
4 |
Correct |
13 ms |
2764 KB |
Output is correct |
5 |
Correct |
12 ms |
2764 KB |
Output is correct |
6 |
Correct |
40 ms |
3120 KB |
Output is correct |
7 |
Correct |
17 ms |
2944 KB |
Output is correct |
8 |
Correct |
552 ms |
5568 KB |
Output is correct |
9 |
Correct |
22 ms |
3020 KB |
Output is correct |
10 |
Correct |
270 ms |
3748 KB |
Output is correct |
11 |
Correct |
17 ms |
2892 KB |
Output is correct |
12 |
Correct |
16 ms |
3028 KB |
Output is correct |
13 |
Correct |
13 ms |
2764 KB |
Output is correct |
14 |
Correct |
14 ms |
2848 KB |
Output is correct |
15 |
Correct |
14 ms |
2892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
94 ms |
5140 KB |
Output is correct |
2 |
Correct |
196 ms |
8588 KB |
Output is correct |
3 |
Correct |
157 ms |
7200 KB |
Output is correct |
4 |
Correct |
94 ms |
5412 KB |
Output is correct |
5 |
Correct |
26 ms |
3204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
2844 KB |
Output is correct |
2 |
Correct |
13 ms |
2764 KB |
Output is correct |
3 |
Correct |
14 ms |
2764 KB |
Output is correct |
4 |
Correct |
13 ms |
2764 KB |
Output is correct |
5 |
Correct |
12 ms |
2764 KB |
Output is correct |
6 |
Correct |
40 ms |
3120 KB |
Output is correct |
7 |
Correct |
17 ms |
2944 KB |
Output is correct |
8 |
Correct |
552 ms |
5568 KB |
Output is correct |
9 |
Correct |
22 ms |
3020 KB |
Output is correct |
10 |
Correct |
270 ms |
3748 KB |
Output is correct |
11 |
Correct |
17 ms |
2892 KB |
Output is correct |
12 |
Correct |
16 ms |
3028 KB |
Output is correct |
13 |
Correct |
13 ms |
2764 KB |
Output is correct |
14 |
Correct |
14 ms |
2848 KB |
Output is correct |
15 |
Correct |
14 ms |
2892 KB |
Output is correct |
16 |
Correct |
94 ms |
5140 KB |
Output is correct |
17 |
Correct |
196 ms |
8588 KB |
Output is correct |
18 |
Correct |
157 ms |
7200 KB |
Output is correct |
19 |
Correct |
94 ms |
5412 KB |
Output is correct |
20 |
Correct |
26 ms |
3204 KB |
Output is correct |
21 |
Correct |
714 ms |
11580 KB |
Output is correct |
22 |
Correct |
600 ms |
13908 KB |
Output is correct |
23 |
Correct |
271 ms |
16432 KB |
Output is correct |
24 |
Execution timed out |
1089 ms |
14908 KB |
Time limit exceeded |
25 |
Halted |
0 ms |
0 KB |
- |