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 confidence[], int host[], int protocol[]) {
int free =0;
for (int i = n-1; i >= 1; i--){
int v = host[i];
if (protocol[i] == 0){
free += confidence[i];
confidence[v]-=confidence[i];
confidence[v] = max(0,confidence[v]);
}
if (protocol[i] == 1){
confidence[v] += confidence[i];
}
if (protocol[i] == 2){
confidence[v] =max(confidence[i],confidence[v]);
}
//printf("%d %d %d %d\n",i,v,p[v],q[v]);
}
return free+confidence[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... |