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;
typedef long long ll;
vector<ll> minimum_costs(vector<int> h,vector<int> l,vector<int> r) {
int n = l.size();
// ll a = h.size();
vector<ll> c(n);
for (int z=0;z<n;z++){
ll left = l[z];
ll right = r[z];
c[z] = LLONG_MAX;
for (int x=left;x<=right;x++){
ll temp = 0;
ll maxi = 0;
for (int y=x;y>=left;y--){
maxi = max(maxi,ll(h[y]));
temp += maxi;
}
maxi = 0;
for (int y=x+1;y<=right;y++){
maxi = max(maxi,ll(h[y]));
temp += maxi;
}
c[z] = min(c[z],temp);
}
}
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... |