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;
#define pb push_back
#define mp make_pair
#define ll long long
#define itr ::iterator
const int MAX=1e5;
int findSample(int n,int confidence[],int host[],int protocol[])
{
int res=0;
for(int A=n-1;A>0;A--)
{
if(confidence[A]<0)
continue;
else if(protocol[A]==0)
{
res+=confidence[A];
confidence[host[A]]-=confidence[A];
confidence[A]=0;
}
else if(protocol[A]==1)
{
confidence[host[A]]+=confidence[A];
confidence[A]=0;
}
else
{
confidence[host[A]]=max(confidence[host[A]],confidence[A]);
confidence[A]=0;
}
}
for(int A=0;A<n;A++)
res+=max(confidence[A],0);
return res;
}
# | 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... |