답안 #872757

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
872757 2023-11-13T16:47:47 Z rainboy Lost Array (NOI19_lostarray) C
100 / 100
22 ms 2572 KB
#include <stdio.h>

#define N	100000

int max(int a, int b) { return a > b ? a : b; }

int main() {
	static int aa[N];
	int n, m, h, i, j, a;

	scanf("%d%d", &n, &m);
	for (i = 0; i < n; i++)
		aa[i] = 1;
	for (h = 0; h < m; h++) {
		scanf("%d%d%d", &i, &j, &a), i--, j--;
		aa[i] = max(aa[i], a), aa[j] = max(aa[j], a);
	}
	for (i = 0; i < n; i++)
		printf("%d ", aa[i]);
	printf("\n");
	return 0;
}

Compilation message

lostarray.c: In function 'main':
lostarray.c:11:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
lostarray.c:15:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |   scanf("%d%d%d", &i, &j, &a), i--, j--;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 5 ms 860 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 5 ms 860 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 604 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 9 ms 536 KB Output is correct
3 Correct 7 ms 604 KB Output is correct
4 Correct 4 ms 436 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 5 ms 860 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 4 ms 604 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 1 ms 348 KB Output is correct
16 Correct 4 ms 348 KB Output is correct
17 Correct 9 ms 536 KB Output is correct
18 Correct 7 ms 604 KB Output is correct
19 Correct 4 ms 436 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 13 ms 1552 KB Output is correct
22 Correct 11 ms 1628 KB Output is correct
23 Correct 14 ms 1628 KB Output is correct
24 Correct 14 ms 1884 KB Output is correct
25 Correct 22 ms 2572 KB Output is correct