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;
int findSample(int n, int conf[], int host[], int prot[]) {
vector<int> omit(n);
for (int i = n; --i;) {
int j = host[i];
conf[j] += prot[i] == 1 ? conf[i] : max(omit[i], omit[j] + conf[i] - conf[j]);
omit[j] += prot[i] == 0 ? conf[i] : omit[i];
conf[j] = max(conf[j], omit[j]);
}
return conf[0];
}
# | 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... |