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 p[1001000],q[100100];
int findSample(int n,int confidence[],int host[],int protocol[]){
memcpy(p,confidence,n*4);
for(int i=n;--i;){
int H=host[i];
if(!protocol[i])
p[H]+=q[i],
q[H]+=max(q[i],p[i]);
else if(protocol[i]&1)
q[H]+=q[i],
p[H]=max({p[H]+p[i],p[H]+q[i],q[H]+p[i]});
else q[H]+=q[i],
p[H]=max(p[H]+q[i],p[i]+q[H]);
}
return max(p[0],q[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... |