#include "bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long
#define vec vector
vec<ll> into(const vec<int> &arr) {
vec<ll> tmp(arr.size());
for (int i = 0; i < arr.size(); i++)
tmp[i] = (ll)arr[i];
return tmp;
}
vec<ll> calculate_costs(vec<int> W_, vec<int> A_, vec<int> B_, vec<int> E_) {
vec<ll> W = into(W_), A = into(A_), B = into(B_), E = into(E_);
int n = W.size();
ll mind = INT_MAX;
ll cost = 0;
for (int i = 0; i < n; i++)
mind = min(mind, A[i] - B[i]), cost += B[i];
if (n % 2 == 1) cost += mind;
vec<ll> res(E.size(), (ll)cost);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |