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 "meetings.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,
std::vector<int> R) {
int Q = L.size();
std::vector<long long> C(Q);
for (int i=0; i<Q; i++) {
int l = L[i], r = R[i];
long long mncost = LLONG_MAX;
for (int j=l; j<=r; j++) {
long long with = 0;
int mc = 0;
for (int T=j; T<=r; T++) {
mc = max(mc, H[T]);
with += mc;
}
mc = 0;
for (int T=j; T>=l; T--) {
mc = max(mc, H[T]);
with += mc;
}
with -= H[j];
mncost = min(mncost, with);
}
C[i] = mncost;
}
return C;
}
# | 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... |