제출 #835736

#제출 시각아이디문제언어결과실행 시간메모리
835736Mohmad_ZaidMeetings (IOI18_meetings)C++17
4 / 100
5573 ms1488 KiB
// #include "meetings.h"
#include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define print(a) for(int i=0;i<a.size();i++)cout<<a[i]<<endl;;
using namespace std;
vector<long long> minimum_costs(vector<int> H, vector<int> L,vector<int> R) {
    int q = L.size();
    vector<long long> C(q);
    for(int i=0;i<q;i++){
        ll mn=LONG_LONG_MAX;
        for(int l=L[i];l<=R[i];l++){
            ll sm=0;
            int mx=0;
            for(int j=l;j>=L[i];j--){
                mx=max(mx,H[j]);
                sm+=mx;
            }
            mx=H[l];
            for(int j=l+1;j<=R[i];j++){
                mx=max(mx,H[j]);
                sm+=mx;
            }
            mn=min(mn,sm);
        }
        C[i]=mn;
    }
    return C;
}
// int main(){
//     vector<ll>c;
//     c=minimum_costs({2, 4, 3, 5}, {0, 1}, {2, 3});
//     print(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...