이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "friend.h"
#include <bits/stdc++.h>
#define pb push_back
#define mk make_pair
#define sc second
#define fr first
using namespace std;
const int N = (1e6 + 5);
int u[1005][1005];
int ans;
vector <int> g[N];
int findSample(int n,int confidence[],int host[],int protocol[]){
for (int i = 1; i < n; i ++) {
int v = host[i];
if (protocol[i] == 0) {
u[v][i] = 1,u[i][v] = 1;
g[v].pb(i),g[i].pb(v);
}
else if (protocol[i] == 1) {
for (auto to : g[v]) {
g[to].pb(i),g[i].pb(to);
u[to][i] = 1,u[i][to] = 1;
}
}
else {
for (auto to : g[v]) {
g[to].pb(i),g[i].pb(to);
u[to][i] = 1,u[i][to] = 1;
}
g[v].pb(i);
g[i].pb(v);
u[v][i] = 1;
u[i][v] = 1;
}
}
for (int i = 0; i < (1 << n); i ++) {
vector <int> v;
int fl = 0;
int as = 0;
for (int j = 0; j < n; j ++) {
if (i & (1 << j)) {
for (auto to : v)
if (u[to][j]) fl = 1;
as += confidence[j];
v.pb(j);
}
}
if (!fl) {
// cout << i << " ---> ";
// for (auto to : v)
// cout << to << " ";
// cout << endl;
if (i == 28)
cout << u[2][3] << endl;
ans = max(ans,as);
}
}
return ans;
}
# | 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... |