# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
784044 | rainboy | Island (NOI18_island) | C11 | 54 ms | 5324 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |