# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
781307 | vjudge1 | Meetings (IOI18_meetings) | C++17 | 3931 ms | 786432 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) {
int n = H.size();
long long C[n][n];
memset(C, 0, sizeof C);
for(int i = 0; i < n; i++) {
int mx = 0;
long long ans = 0;
for(int j = i; j < n; j++)
C[i][j] = ans += mx = max(mx, H[j]);
ans = 0;
mx = 0;
for(int j = i+1; j--;)
C[i][j] = ans += mx = max(mx, H[j]);
}
vector<long long> ans(L.size(), 1e18);
for(int i = 0; i < L.size(); i++)
for(int j = L[i]; j <= R[i]; j++)
ans[i] = min(ans[i], C[j][L[i]]+C[j][R[i]]-H[j]);
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... |