| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 488534 | rainboy | Logičari (COCI21_logicari) | C11 | 26 ms | 284 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define N 20
int min(int a, int b) { return a < b ? a : b; }
int main() {
static int bb[N];
int n, h, i, j, b, k_;
scanf("%d", &n);
if (n > N) {
printf("%d\n", n % 4 == 0 ? n / 2 : -1);
return 0;
}
for (h = 0; h < n; h++) {
scanf("%d%d", &i, &j), i--, j--;
bb[i] |= 1 << j, bb[j] |= 1 << i;
}
k_ = n + 1;
for (b = 0; b < 1 << n; b++) {
int b_ = 0, k = 0;
for (i = 0; i < n; i++)
if ((b & 1 << i) != 0) {
if ((b_ & bb[i]) != 0) {
b_ = -1;
break;
}
b_ |= bb[i], k++;
}
if (b_ == (1 << n) - 1)
k_ = min(k_, k);
}
if (k_ == n + 1)
k_ = -1;
printf("%d\n", k_);
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... | ||||
