| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 392282 | rainboy | Friend (IOI14_friend) | C11 | 31 ms | 1316 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "friend.h"
#define N 1000
#define SMALL 10
int max(int a, int b) { return a > b ? a : b; }
int findSample(int n, int *aa, int *pp, int *tt) {
static int bb[SMALL], cc[N];
int i, j, b, ans;
ans = 0;
if (n <= SMALL) {
for (i = 1; i < n; i++) {
if (tt[i] == 0)
bb[i] = 1 << pp[i];
else if (tt[i] == 1)
bb[i] = bb[pp[i]];
else
bb[i] = bb[pp[i]] | 1 << pp[i];
for (j = 0; j < n; j++)
if ((bb[i] & 1 << j) != 0)
bb[j] |= 1 << i;
}
for (b = 0; b < 1 << n; b++) {
int sum;
sum = 0;
for (i = 0; i < n; i++)
if ((b & 1 << i) != 0) {
if ((bb[i] & b) != 0) {
sum = 0;
break;
}
sum += aa[i];
}
ans = max(ans, sum);
}
} else
for (i = 0; i < n; i++)
ans += aa[i];
return ans;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
