# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
236983 | crossing0ver | 친구 (IOI14_friend) | C++17 | 7 ms | 2688 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "friend.h"
using namespace std;
const int MAXN = 1E5+5;
int n,val[MAXN];
vector<int> adj[MAXN];
int case1(){
int mxval = 0;
for (int i = 0; i < (1 << n); i++) {
vector<int> x;
for (int j = 0; j < n; j++) {
if ( (1 << j) & i)
x.push_back(j);
}
bool flag = 1;
for (int j = 0; j < x.size(); j++) {
for (int k = 0; k < j; k++) {
for (int h : adj[x[j]])
if (h == x[k]) flag = 0;
}
}
if (flag) {
int s = 0;
for (int j:x) s += val[j];
mxval = max(mxval,s);
}
}
return mxval;
}
int findSample(int n1,int confidence[],int host[],int protocol[]){
n = n1;
int type[] = {1,1,1};
for (int i =0; i < n; i++) val[i] = confidence[i];
for (int i = 1; i < n; i++) {
int x = protocol[i];
int v = host[i];
for (int i =0; i< 3; i++) if (x != i ) type[i] = 0;
if (x == 0) {
adj[v].push_back(i);
adj[i].push_back(v);
}
else {
adj[i] = adj[v];
if (x == 3) {
adj[i].push_back(v);
adj[v].push_back(i);
}
}
}
if (n <= 10) return case1();
}
컴파일 시 표준 에러 (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... |