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 no[100000];
int findSample(int n,int confidence[],int host[],int protocol[]){
ios_base::sync_with_stdio(false);cin.tie(NULL);
for(int i=n-1;i>0;--i){
switch(protocol[i]){
case 0:
confidence[host[i]]+=no[i];
no[host[i]]+=max(confidence[i],no[i]);
break;
case 1:
confidence[host[i]]=max(confidence[host[i]]+confidence[i],max(confidence[host[i]]+no[i],no[host[i]]+confidence[i]));
no[host[i]]+=no[i];
break;
case 2:
confidence[host[i]]=max(confidence[host[i]]+no[i],no[host[i]]+confidence[i]);
no[host[i]]+=no[i];
}
}
return max(confidence[0],no[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... |