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>
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
template<class T>bool tmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool tmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
vector<ll> C;
int jem[5000][5000];
std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,std::vector<int> R)
{
for (int i=0;i<sz(H);i++)
{
int mx=0;
for (int j=0;j<i;j++)
{
mx=max(mx,H[j]);
jem[i][j]=mx;
}
mx=0;
for (int j=i;j<=sz(H);j++)
{
mx=max(mx,H[j]);
jem[i][j]=mx;
}
}
for (int i=0;i<sz(L);i++)
{
ll res=INT_MAX;
for (int j=L[i];j<=R[i];j++)
{
ll sum=0;
for (int k=L[i];j<=R[i];j++)
{
sum+=jem[j][k];
}
res=min(res,sum);
}
C.pb(res);
}
return C;
}
# | 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... |