Submission #292430

#TimeUsernameProblemLanguageResultExecution timeMemory
292430zoooma13Meetings (IOI18_meetings)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "meetings.h" #include "grader.cpp" using namespace std; vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){ assert(H.size() <= 5000); vector <long long> dpL(H.size()) ,dpR(H.size()) ,ans(L.size() ,LLONG_MAX); for(int q = 0; q < L.size(); q++){ int l = L[q] ,r = R[q]; long long cur = 0; vector <int> mq{l-1}; for(int i=l; i<=r; i++){ while(mq.size()>1 && H[mq.back()] <= H[i]){ cur -= (mq.back()-mq[(int)mq.size()-2])*H[mq.back()]; mq.pop_back(); } mq.push_back(i); cur += (mq.back()-mq[(int)mq.size()-2])*H[mq.back()]; dpL[i] = cur; } mq = {r+1} ,cur = 0; for(int i=r; i>=l; i--){ while(mq.size()>1 && H[mq.back()] <= H[i]){ cur -= (mq[(int)mq.size()-2]-mq.back())*H[mq.back()]; mq.pop_back(); } mq.push_back(i); cur += (mq[(int)mq.size()-2]-mq.back())*H[mq.back()]; dpR[i] = cur; } for(int i=l; i<=r; i++) ans[q] = min(ans[q] ,dpL[i]+dpR[i]-H[i]); } return ans; }

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:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int q = 0; q < L.size(); q++){
      |                    ~~^~~~~~~~~~
/tmp/ccPg6SKJ.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccHfIfMH.o:meetings.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status