제출 #813310

#제출 시각아이디문제언어결과실행 시간메모리
813310OrazB선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define ll long long int #define pii pair <int, int> #define pb push_back #define ff first #define ss second const int N = 1e7+5; ll suff[N], pref[N], dp[N]; ll F(ll x, int t, ll L){ ll cur = (t ? (L-x)*2 : x*2); return min(L, cur); } ll delivery(int n, int K, int L, int p[]){ dp[0] = min(F(p[0], 1, L), F(p[0], 0, L)); for (int i = 1; i < n; i++){ dp[i] = 1e18; for (int j = i; j >= 0; j--){ if (i-j+1 > K) break; dp[i] = min(dp[i], (j ? dp[j-1] : 0)+min(F(p[i], 0, L), F(p[j], 1, L))); } assert(dp[i] > dp[i-1]); } return dp[n-1]; } int main () { ios::sync_with_stdio(false); cin.tie(0); int n, k, l; cin >> n >> k >> l; int p[n]; for (int i = 0; i < n; i++) cin >> p[i]; cout << delivery(n, k, l, p); }

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

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