Submission #784044

#TimeUsernameProblemLanguageResultExecution timeMemory
784044rainboyIsland (NOI18_island)C11
100 / 100
54 ms5324 KiB
#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 (stderr)

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--;
      |   ^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...