# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1024873 | Zicrus | Meetings (IOI18_meetings) | C++17 | 5583 ms | 1884 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 <bits/stdc++.h>
#include "meetings.h"
using namespace std;
typedef long long ll;
vector<ll> minimum_costs(vector<int> h, vector<int> l, vector<int> r) {
ll n = h.size(), q = l.size();
vector<ll> res;
if (/*n <= 3000 && q <= 10*/ true) {
for (int q1 = 0; q1 < q; q1++) {
ll mnSum = 1 << 30;
for (int c = l[q1]; c <= r[q1]; c++) {
ll sum = 0;
int mx = 0;
for (int i = c; i >= l[q1]; i--) {
mx = max(mx, h[i]);
sum += mx;
}
mx = h[c];
for (int i = c + 1; i <= r[q1]; i++) {
mx = max(mx, h[i]);
sum += mx;
}
mnSum = min(mnSum, sum);
}
res.push_back(mnSum);
}
return res;
}
return res;
}
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... |