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 ans=0;
if (protocol[1]==1) {
for (int a=0; a<=n; a++) ans+=confidence[a];
} else if (protocol[1]==2) {
for (int a=0; a<=n; a++) ans=max(ans, confidence[a]);
} else {
int bi[n+5];
memset(bi, -1, sizeof(bi));
bi[0]=0;
for (int a=1; a<=n; a++) {
if (bi[host[a]]==0) bi[a]=1;
else bi[a]=0;
}
int total=0;
for (int a=0; a<=n; a++) {
total+=confidence[a];
if (bi[a]==1) ans+=confidence[a];
}
ans=max(ans, total-ans);
}
return ans;
}
# | 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... |