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;
#define pb push_back
#define sz(a) a.size()
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 j = 0; j < Q; j++){
long long ans=3000000000007;
for(int i=L[j];i<=R[j];i++){
int l=H[i];
long long s=H[i];
for(int k=i-1;k>=L[j];k--){
l=max(l,H[k]);
s+=l;
}
l=H[i];
for(int k=i+1;k<=R[j];k++){
l=max(l,H[k]);
s+=l;
}
ans=min(ans,s);
}
C[j]=ans;
}
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... |