답안 #784044

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
784044 2023-07-15T15:22:40 Z rainboy Island (NOI18_island) C
100 / 100
54 ms 5324 KB
#include <stdio.h>

#define N	200000
#define M	200000

int main() {
	static int dd[M], kk[N + M];
	int n, m, h, i, j, a;

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

Compilation message

island.c: In function 'main':
island.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d%d", &n, &m);
      |  ^~~~~~~~~~~~~~~~~~~~~
island.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d%d", &i, &j), i--, j--;
      |   ^~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 46 ms 4812 KB Output is correct
4 Correct 54 ms 5324 KB Output is correct
5 Correct 10 ms 1172 KB Output is correct
6 Correct 50 ms 5264 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 340 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 300 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 46 ms 4812 KB Output is correct
4 Correct 54 ms 5324 KB Output is correct
5 Correct 10 ms 1172 KB Output is correct
6 Correct 50 ms 5264 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 0 ms 340 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 0 ms 212 KB Output is correct
17 Correct 1 ms 300 KB Output is correct
18 Correct 1 ms 212 KB Output is correct
19 Correct 0 ms 300 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
23 Correct 0 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 296 KB Output is correct
26 Correct 2 ms 468 KB Output is correct
27 Correct 48 ms 5136 KB Output is correct
28 Correct 50 ms 5324 KB Output is correct
29 Correct 18 ms 2440 KB Output is correct
30 Correct 28 ms 3596 KB Output is correct
31 Correct 5 ms 792 KB Output is correct
32 Correct 3 ms 596 KB Output is correct
33 Correct 27 ms 3540 KB Output is correct
34 Correct 26 ms 3436 KB Output is correct
35 Correct 28 ms 3592 KB Output is correct
36 Correct 29 ms 3876 KB Output is correct
37 Correct 0 ms 212 KB Output is correct