# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
139358 | wilwxk | Meetings (IOI18_meetings) | C++14 | 5600 ms | 1620 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;
typedef long long ll;
const int MAXN=1e5+5;
vector<int> h, l, r;
vector<ll> respf;
ll anda(int ini, int fim) {
if(ini>fim) swap(ini, fim);
ll val=-1;
for(int i=ini; i<=fim; i++) val=max(val, (ll)h[i]);
return val;
}
ll query(int ini, int fim) {
ll resp=1e18;
for(int i=ini; i<=fim; i++) {
ll val=0;
for(int j=ini; j<=fim; j++) val+=anda(j, i);
resp=min(resp, val);
}
return resp;
}
std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,
std::vector<int> R) {
h=H; l=L; r=R;
for(int i=0; i<L.size(); i++) {
int ini=L[i]; int fim=R[i];
ll val=query(ini, fim);
respf.push_back(val);
}
// int Q = L.size();
// std::vector<long long> C(Q);
// for (int j = 0; j < Q; ++j) {
// C[j] = H[L[j]];
// }
return respf;
}
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... |