# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713872 | LittleOrange | Meetings (IOI18_meetings) | C++17 | 5598 ms | 1488 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;
using ll = long long;
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);
int N = H.size();
for (ll qi = 0; qi < Q; qi++){
ll l = L[qi],r=R[qi];
function<ll(ll)> query = [&](ll x){
ll ans = 0;
int cur = 0;
for(ll i = x;i<=R[qi];i++){
cur = max(cur,H[i]);
ans += cur;
}
cur = H[x];
for(ll i = x-1;i>=L[qi];i--){
cur = max(cur,H[i]);
ans += cur;
}
return ans;
};
C[qi] = 1e18;
for(ll x = l;x<=r;x++) C[qi] = min(C[qi],query(x));
}
return C;
}
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... |