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 <cstdio>
#include <cassert>
#define __MAXSIZE__ 100002
#include "friend.h"
#include<bits/stdc++.h>
using namespace std;
set<int,greater<int> > s;
int with[100100],without[100100];
int findSample(int n,int confidence[],int host[],int protocol[]){
for(int i=n-1;i>0;i--)
{
with[i]+=confidence[i];
if(protocol[i]==0)
{
without[host[i]]+=max(with[i],without[i]);
with[host[i]]+=without[i];
}
if(protocol[i]==1)
with[host[i]]+=with[i];
if(protocol[i]==2)
{
confidence[host[i]]=max(confidence[i],confidence[host[i]]);
without[host[i]]+=without[i];
}
}
return max(with[0]+confidence[0],without[0]);
}
using namespace std;
# | 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... |