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>
#define ll long long
using namespace std;
int findSample(int n,int confidence[],int host[],int protocol[]){
bool eq = 1;
for(int j = 1; j < n - 1; j++) {
if(protocol[j] != protocol[j + 1])
eq = 0;
}
if(eq) {
if(protocol[1] == 1) {
// empty
ll sum = 0;
for(int j = 0; j < n; j++)
sum += confidence[j];
return sum;
} else if(protocol[1] == 2) {
// full
ll mx = 0;
for(int j = 0; j < n; j++)
mx = max(mx, (ll)confidence[j]);
return mx;
} else if(protocol[1] == 0) {
// tree
return -1;
}
}
return 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... |