# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
69719 | E869120 | 친구 (IOI14_friend) | C++14 | 46 ms | 3256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "friend.h"
#include <algorithm>
#include <vector>
using namespace std;
// Find out best sample
int p[10][10];
int findSample(int n, int confidence[], int host[], int protocol[]) {
if (n <= 10) {
for (int i = 1; i < n; i++) {
if (protocol[i] == 0) { p[host[i]][i] = 1; p[i][host[i]] = 1; }
if (protocol[i] == 1) {
for (int j = 0; j < n; j++) { if (p[host[i]][j] == 1) { p[j][i] = 1; p[i][j] = 1; } }
}
if (protocol[i] == 2) {
for (int j = 0; j < i; j++) { p[j][i] = 1; p[i][j] = 1; }
}
}
int maxn = 0;
for (int i = 0; i < (1 << n); i++) {
vector<int>vec;
for (int j = 0; j < n; j++) { if ((i / (1 << j)) % 2 == 1) vec.push_back(j); }
bool OK = true;
for (int j = 0; j < vec.size(); j++) {
for (int k = j + 1; k < vec.size(); k++) {
if (p[vec[j]][vec[k]] == 1) OK = false;
}
}
if (OK == false) continue;
int bit = 0; for (int j = 0; j < vec.size(); j++) bit += confidence[vec[j]];
maxn = max(maxn, bit);
}
return maxn;
}
else {
int maxn = 0;
for (int i = 0; i < n; i++) maxn = max(maxn, confidence[i]);
return maxn;
}
}
컴파일 시 표준 에러 (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... |