# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
421771 | Jasiekstrz | Meetings (IOI18_meetings) | C++17 | 5531 ms | 1124 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"
#define fi first
#define se second
using namespace std;
const int NN=75e4;
const long long INF=(long long)1e18+7;
vector<long long> minimum_costs(vector<int> H,vector<int> L,vector<int> R)
{
int n=H.size();
int q=L.size();
vector<long long> ans;
for(int qi=0;qi<q;qi++)
{
int l=L[qi],r=R[qi];
long long w=INF;
for(int i=l;i<=r;i++)
{
long long tmp=H[i];
long long mx=H[i];
for(int j=i-1;j>=l;j--)
{
mx=max(mx,(long long)H[j]);
tmp+=mx;
}
mx=H[i];
for(int j=i+1;j<=r;j++)
{
mx=max(mx,(long long)H[j]);
tmp+=mx;
}
w=min(w,tmp);
}
ans.push_back(w);
}
return ans;
}
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... |