| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 545140 | rainboy | 사육제 (CEOI14_carnival) | C11 | 9 ms | 276 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#include <string.h>
#define N 150
int query(int *ii, int k) {
int h, x;
printf("%d", k);
for (h = 0; h < k; h++)
printf(" %d", ii[h] + 1);
printf("\n"), fflush(stdout);
scanf("%d", &x);
return x;
}
int main() {
static int ii[N], ii_[N], hh[N];
int n, n_, i;
scanf("%d", &n);
n_ = 0;
for (i = 0; i < n; i++) {
ii[n_] = i;
if (query(ii, n_ + 1) == n_ + 1)
hh[i] = n_++;
else {
int lower = 0, upper = n_;
while (upper - lower > 1) {
int h = (lower + upper) / 2;
memcpy(ii_, ii + lower, (h - lower) * sizeof *ii);
ii_[h - lower] = i;
if (query(ii_, h - lower + 1) == h - lower + 1)
lower = h;
else
upper = h;
}
hh[i] = lower;
}
}
printf("0");
for (i = 0; i < n; i++)
printf(" %d", hh[i] + 1);
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... | ||||
