# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
823340 | Trumling | Meetings (IOI18_meetings) | C++14 | 5559 ms | 1492 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 F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define INF 99999999999999999
#define pb push_back
vector<long long> minimum_costs(vector<int> H, std::vector<int> L,
std::vector<int> R) {
ll Q=L.size();
ll N=H.size();
vector<ll>C(Q,INF);
for(int i=0;i<Q;i++)
for(int j=L[i];j<=R[i];j++)
{
ll curr=0,maxi=-1;
for(int c=j;c>=L[i];c--)
{
maxi=max(maxi,(ll)H[c]);
curr+=maxi;
}
maxi=H[j];
for(int c=j+1;c<=R[i];c++)
{
maxi=max(maxi,(ll)H[c]);
curr+=maxi;
}
C[i]=min(C[i],curr);
}
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... |