# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944125 | beepbeepsheep | Meetings (IOI18_meetings) | C++17 | 326 ms | 2900 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;
#define ll long long
const ll inf=1e18;
std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,
std::vector<int> R) {
ll n=H.size();
ll q=L.size();
vector<ll> ans;
ll arr[3005];
for (int i=0;i<q;i++){
ll tot=inf;
for (int j=L[i];j<=R[i];j++){
ll curr=0;
memset(arr,0,sizeof(arr));
arr[j]=H[j];
for (int k=j-1;k>=L[i];k--){
arr[k]=max<ll>(arr[k+1],H[k]);
}
for (int k=j+1;k<=R[i];k++){
arr[k]=max<ll>(arr[k-1],H[k]);
}
for (int k=L[i];k<=R[i];k++) curr+=arr[k];
tot=min(tot,curr);
}
ans.emplace_back(tot);
}
return ans;
}
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... |