제출 #1148164

#제출 시각아이디문제언어결과실행 시간메모리
1148164Kaztaev_Alisher모임들 (IOI18_meetings)C++20
컴파일 에러
0 ms0 KiB
#include "meetings.h" #include <bits/stdc++.h> #define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) #define all(a) a.begin() , a.end() #define F first #define S second #define int ll using namespace std; using ll = long long; const ll N = 5555 , inf = 2e9 + 7; const ll INF = 1e18 , mod = 1e9+7; int pr[N][N] , sf[N][N] , a[N]; vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R) { int Q = L.size(); int n = H.size(); vector<long long> C(Q); for(int i = 1; i <= n; i++){ a[i] = H[i-1]; } for(int l = 1; l <= n; l++){ int mx = a[l]; for(int r = l; r <= n; r++){ mx = max(mx , a[r]); pr[l][r] = pr[l][r-1] + mx; } } for(int r = n; r >= 1; r--){ int mx = a[r]; for(int l = r; l >= 1; l--){ mx = max(mx , a[l]); sf[r][l] = sf[r][l+1] + mx; } } for(int i = 0; i < Q; i++){ L[i]++; R[i]++; C[i] = inf; for(int j = L[i]; j <= R[i]; j++){ C[i] = min(C[i] , pr[L[i]][j-1]+sf[R[i]][j+1]+a[j]); } } return C; }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/ccCFAjwd.o: in function `main':
grader.cpp:(.text.startup+0x1d6): undefined reference to `minimum_costs(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status