제출 #390214

#제출 시각아이디문제언어결과실행 시간메모리
390214mariowong선물상자 (IOI15_boxes)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long n,m,l,a[10000005],dp[10000005]; deque <int> dq; int main(){ ios::sync_with_stdio(false); cin >> n >> m >> l; for (int i=1;i<=n;i++){ cin >> a[i]; } for (int i=1;i<=n;i++){ while (!dq.empty() && dq.front()+m <= i) dq.pop_front(); if (!dq.empty()) dp[i]=min(dp[max(0LL,i-m)]+a[i]*2,dp[dq.front()]+2*l-2*a[dq.front()+1]); else dp[i]=dp[max(0LL,i-m)]+a[i]*2; while (!dq.empty() && dp[dq.back()]-2*a[dq.back()+1] > dp[i]-2*a[i+1]) dq.pop_back(); dq.push_back(i); } cout << dp[n] << "\n"; return 0; }

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

/tmp/ccZ4xsuN.o: In function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'
/tmp/ccmNsr8u.o:boxes.cpp:(.text.startup+0x0): first defined here
/tmp/ccZ4xsuN.o: In function `main':
grader.c:(.text.startup+0x1cb): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status