Submission #624619

#TimeUsernameProblemLanguageResultExecution timeMemory
624619Icebear16Meetings (IOI18_meetings)C++14
4 / 100
5571 ms1772 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define sz(a) a.size() std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L,std::vector<int> R) { int Q = L.size(); std::vector<long long> C(Q); for (int j = 0; j < Q; j++){ long long ans=3000000000007; for(int i=L[j];i<=R[j];i++){ int l=H[i]; long long s=H[i]; for(int k=i-1;k>=L[j];k--){ l=max(l,H[k]); s+=l; } l=H[i]; for(int k=i+1;k<=R[j];k++){ l=max(l,H[k]); s+=l; } ans=min(ans,s); } 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...