Submission #836469

#TimeUsernameProblemLanguageResultExecution timeMemory
836469IS_RushdiMeetings (IOI18_meetings)C++17
Compilation error
0 ms0 KiB
//#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define ll long long vector<long long> minimum_costs(vector<int> H, vector<int> L,vector<int> R) { int q = L.size(); int n = H.size(); vector<ll> ans(q); vector<vector<ll>> mn(n,vector<ll>(n,1e18)); for(int i = 0; i < n; i++){ mn[i][i] = H[i]; int curr = H[i]; for(int j = i-1; j >= 0; j--){ curr = min(curr,H[j]); mn[j][i] = curr; }curr = H[i]; for(int j = i+1; j < n; j++){ curr = min(curr,H[j]); mn[j][i] = curr; } } for(int i = 0; i < n; i++){ for(int j = 1; j < n; j++){ mn[j][i] += mn[j-1][i]; } } for(int v = 0; v < q; v++){ int l = L[v]; int r = R[v]; ll cnt = 1e18; for(int i = l; i <= r; i++){ if(l == 0)cnt = min(cnt,mn[r][i]); else cnt = min(cnt,mn[r][i]-mn[l-1][i]); } ans[v] = cnt; } return ans; } int main(){ }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccDMTg4B.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccWEHTcA.o:meetings.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status