Submission #360355

#TimeUsernameProblemLanguageResultExecution timeMemory
360355beksultan04Meetings (IOI18_meetings)C++14
4 / 100
5570 ms1516 KiB
#include "meetings.h" #ifndef EVAL #include "grader.cpp" #endif // EVAL #include <bits/stdc++.h> using namespace std; #define lol long long #define pii pair<int,int> #define OK puts("OK"); #define NO puts("NO"); #define YES puts("YES"); #define fr first #define sc second #define ret return #define scanl(a) scanf("%lld",&a); #define scanll(a,b) scanf("%lld %lld",&a, &b); #define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define scan1(a) scanf("%d",&a); #define scan2(a,b) scanf("%d %d",&a, &b); #define scan3(a,b,c) scanf("%d %d %d",&a,&b,&c); #define all(s) s.begin(),s.end() #define allr(s) s.rbegin(),s.rend() #define pb push_back #define sz(v) (int)v.size() #define endi puts(""); #define eps 1e-12 vector<lol> minimum_costs(vector<int> H, vector<int> L,vector<int> R) { int i,j,k,Q = L.size(); vector<lol> C(Q); for (j = 0; j < Q; ++j){ C[j] = 1e15+7; for (i=L[j];i<=R[j];++i){ lol mx = 0,ans=0; for (k=i;k>=L[j];--k){ mx = max(mx,H[k]*1ll); ans += mx; } mx = 0; for (k=i+1;k<=R[j];++k){ mx = max(mx,H[k]*1ll); ans += mx; } C[j] = min(C[j],ans); } } return C; }
#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...