Submission #293640

#TimeUsernameProblemLanguageResultExecution timeMemory
293640MuhammetaliMeetings (IOI18_meetings)C++11
0 / 100
5523 ms1208 KiB
#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;} vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { vl v; REP(i,sz(L)) { ll res=INT_MAX; FOR(j,L[i],R[i]) { ll jem=0; int mx=0; for (ll l=j;l>=L[i];l--) { mx=max(mx,H[l]); jem+=mx; } mx=H[j]; for (ll l=j+1;l<=R[i];l++) { mx=max(mx,H[l]); jem+=mx; } res=min(res,jem); } v.pb(res); } return v; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...