This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "friend.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mk make_pair
const int N = 2005;
vector<int> v;
vector<int> edge[N];
int val[N];
bool visited[N];
int orson[N];
int oroogui[N];
void dfs(int k) {
visited[k] = 1;
for(auto x: edge[k]) {
if(visited[x] == 1) continue;
dfs(x);
orson[k] += oroogui[x];
oroogui[k] += max(orson[x], oroogui[x]);
}
orson[k] += val[k];
}
// Find out best sample
int findSample(int n, int confidence[], int host[], int protocol[]){
// subtask 2 my friends are your friends
for(int i = 1; i < n; i ++) {
// host[i] / protocol[i]
for(auto x: edge[host[i]]) {
edge[x].pb(i);
edge[i].pb(x);
}
}
int ret = 0;
for(int i = 0; i < n; i ++) ret = max(ret, confidence[i]);
return ret;
}
# | 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... |