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 FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define f first
#define s second
#define pb push_back
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
const int MAXN = 100100;
int n;
int conf[MAXN], h[MAXN], prot[MAXN];
int sub2 () {
int ret = 0;
FOR(i, 0, n-1) ret += conf[i];
return ret;
}
int sub3 () {
int ret = 0;
FOR(i, 0, n-1) ret = max(ret, conf[i]);
return ret;
}
int findSample(int N,int confidence[],int host[],int protocol[]){
n = N;
FOR(i, 0, n-1) conf[i] = confidence[i];
FOR(i, 1, n-1) h[i] = host[i], prot[i] = protocol[i];
bool is2 = true;
bool is3 = true;
FOR(i, 1, n-1) {
if (protocol[i] != 1) is2 = false;
if (protocol[i] != 2) is3 = false;
}
if (is2)
return sub2();
else if (is3)
return sub3();
else
return sub3();
}
# | 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... |