# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293535 | Muhammetali | 모임들 (IOI18_meetings) | C++11 | 0 ms | 0 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>
#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
#define REP(i,a) for (int i = 0; i < (a); ++i)
#define FOR(i,a,b) for (int i = (a); i <= (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define trav(a,x) for (auto& a: x)
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;
const int N=2e5+1;
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;}
ll n,q;
vl H,L,R;
vector<long long> minimum_costs(std::vector<ll> H, std::vector<ll> L, std::vector<ll> R)
{
vl v;
REP(i,sz(L))
{
ll res=INT_MAX;
FOR(j,L[i],R[i])
{
ll jem=0;
FOR(k,L[i],R[i])
{
ll sum=0;
if (k<=j)
{
FOR(l,k,j)
{
sum=max(sum,H[l]);
}
}
else
{
FOR(l,j,k)
{
sum=max(sum,H[l]);
}
}
jem+=sum;
}
res=min(res,jem);
}
v.pb(res);
}
return v;
}