# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
115422 | dsjong | Meetings (IOI18_meetings) | C++14 | 5584 ms | 1208 KiB |
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;
vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){
vector<long long>ret;
for(int q=0;q<L.size();q++){
int l=L[q],r=R[q];
long long res=LONG_LONG_MAX;
for(int i=l;i<=r;i++){
long long ans=0,maxi=0;
for(int j=i;j>=l;j--){
maxi=max((long long)H[j],maxi);
ans+=maxi;
}
maxi=0;
for(int j=i;j<=r;j++){
maxi=max((long long)H[j],maxi);
ans+=maxi;
}
res=min(res,ans-H[i]);
}
ret.push_back(res);
}
return ret;
}
Compilation message (stderr)
# | 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... |