Submission #992439

#TimeUsernameProblemLanguageResultExecution timeMemory
992439MrM7mdMeetings (IOI18_meetings)C++17
0 / 100
5579 ms1280 KiB
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
const int NN=1e6+50000;
const int MOD=1e9+7;
const int off=(1<<11);


vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){
    vector<long long>v;
    for(int i=0;i<L.size();i++){
        long long ans=1e18;
        for(int j=L[i];j<=R[i];j++){
            int mx=H[j];
            int cur=mx;
            for(int k=j-1;k>=L[i];k--){
                mx=max(mx,H[k]);
                cur+=mx;
            }
            mx=H[j];
            for(int k=j+1;k<=R[i];k++){
                mx=max(mx,H[k]);
                cur+=mx;
            }
            ans=min(ans,(long long)mx);
        }
        v.pb(ans);
    }
    return v;
}

// signed main(){
//     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

// }

Compilation message (stderr)

meetings.cpp: In function 'std::vector<long long int> minimum_costs(std::vector<int>, std::vector<int>, std::vector<int>)':
meetings.cpp:16:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for(int i=0;i<L.size();i++){
      |                 ~^~~~~~~~~
#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...