# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944143 | teacup | Meetings (IOI18_meetings) | C++14 | 0 ms | 348 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;
#define int long long
#define ii pair<int,int>
typedef vector<int> vi;
#define iii tuple<int,int,int>
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef map<int,int> mii;
#ifndef debug
#define cerr if (0) cerr
#endif
const int INF=1e17;
int32_t A[5005];
vi minimum_costs(vector<int32_t> H, vector<int32_t> L,
vector<int32_t> R) {
int Q = L.size(), N = H.size();
vi C;
for (int _=0; _<Q; _++){
int L_ = L[_], R_ = R[_], actual_ans=INF;
for (int i=L_; i<=R_; i++){
int ans=0;
memset(A,0,sizeof(A));
for (int j = i-1; j >= L_; j--){
A[j] = max(A[j+1], H[j]);
}
for (int j = i+1; j <= R_; j++){
A[j] = max(A[j-1], H[j]);
}
for (int j=L_; j<=R_; j++) ans+=A[j];
actual_ans = min(ans, actual_ans);
}
C.push_back(actual_ans);
}
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... |