# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
545919 | rainboy | Lottery (CEOI18_lot) | C11 | 832 ms | 8208 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 10000
#define Q 100
int main() {
static int aa[N], hh[N + 1], kk[Q], pp[Q + 1][N];
int n, q, l, h, i, d, k;
scanf("%d%d", &n, &l);
for (i = 0; i < n; i++)
scanf("%d", &aa[i]);
scanf("%d", &q);
for (h = 0; h < q; h++) {
scanf("%d", &kk[h]);
if (kk[h] < l)
hh[kk[h] + 1]++;
}
for (k = 1; k <= l; k++)
hh[k] += hh[k - 1];
for (d = 1; d < n; d++)
for (i = 0, k = 0; i + d < n; i++) {
if (aa[i] != aa[i + d])
k++;
if (i >= l - 1) {
h = hh[k];
pp[h][i - l + 1]++, pp[h][i + d - l + 1]++;
if (aa[i - l + 1] != aa[i + d - l + 1])
k--;
}
}
for (h = 1; h <= q; h++)
for (i = 0; i + l <= n; i++)
pp[h][i] += pp[h - 1][i];
for (h = 0; h < q; h++) {
for (i = 0; i + l <= n; i++)
printf("%d ", pp[hh[kk[h]]][i]);
printf("\n");
}
return 0;
}
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |