# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1073760 | shezitt | Meetings (IOI18_meetings) | C++14 | 73 ms | 2908 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 ll = long long;
#define fore(a, b, c) for(int a=b; a<c; ++a)
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
using namespace std;
std::vector<ll> minimum_costs(vector<int> H, vector<int> L, vector<int> R) {
int Q = L.size();
vector<ll> C(Q);
int N = 0;
for (int j = 0; j < Q; ++j) {
N = max(N, R[j]);
}
N++;
if(Q <= 10 && N <= 3001){
// sb 1
for(int j=0; j<Q; ++j){
int l = L[j], r = R[j];
ll ans = 4e18;
for(int x=l; x<=r; ++x){
ll cur = 0;
ll mx = H[x];
for(int i=x; i>=l; --i){
mx = max(mx, 1ll * H[i]);
cur += mx;
}
mx = H[x];
for(int i=x+1; i<=r; ++i){
mx = max(mx, 1ll * H[i]);
cur += mx;
}
ans = min(ans, cur);
}
C[j] = ans;
}
return C;
}
// sb2
vector<int> doses;
fore(i, 0, N){
if(H[i] == 2){
doses.push_back(i);
}
}
fore(j, 0, Q){
int l = L[j], r = R[j];
}
}
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... |