제출 #259806

#제출 시각아이디문제언어결과실행 시간메모리
259806Hehehe선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> //:3 using namespace std; typedef long long ll; #define all(a) (a).begin(), (a).end() #define ff first #define ss second #define pb push_back #define mp make_pair #define pi pair<long double, long double> #define sz(x) (int)((x).size()) //#define int long long #include "boxes.h" const int dx[] = {0, 1, 0, -1}; const int dy[] = {1, 0, -1, 0}; const ll inf = 2e9; const ll mod = 1e9 + 7; const int N = 2e6 + 11; const ll INF64 = 3e18 + 1; const double eps = 1e-14; const double PI = acos(-1); //ifstream in(".in"); //ofstream out(".out"); ll delivery(int n, int k, int L, vector<int> pos){ ll dp1[n + 5], dp2[n + 5]; vector<int>pos2; for(int i = 0; i < n; i++){ pos2.push_back(pos[i]); } reverse(all(pos2)); for(int i = 0; i < n; i++){ dp1[i] = (i < k ? 2ll*pos[i] : dp1[i - k] + 2ll*pos[i]); } for(int i = n - 1; i >= 0; i--){ dp2[i] = (i + k >= n ? 2ll*(L - pos[i]) : dp2[i + k] + 2ll*(L - pos[i])); //cout << i << ' ' << (L - pos[i]) << '\n'; } ll ans = min(dp2[0], dp1[n - 1]); //cout << "pos" << '\n'; //for(int i = 0; i < n; i++)cout << pos[i] << ' '; cout << '\n'; //cout << "dp1" << '\n'; //for(int i = 0; i < n; i++)cout << dp1[i] << ' '; cout << '\n'; //cout << "dp2" << '\n'; //for(int i = 0; i < n; i++)cout << dp2[i] << ' '; cout << '\n'; for(int i = 0; i < n - 1; i++){ ans = min(ans, dp1[i] + dp2[i + 1]); } for(int i = 0; i < n; i++){ if(i + k + 1 >= n)continue; ans = min(ans, dp1[i] + L + dp2[i + k + 1]); } return ans; }

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

/tmp/ccDeLnhj.o: In function `main':
grader.c:(.text.startup+0x22f): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status