제출 #947609

#제출 시각아이디문제언어결과실행 시간메모리
9476094QT0R선물상자 (IOI15_boxes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long ll pref[10000002]; ll suf[10000002]; ll delivery(ll n, ll k, ll l, ll positions[]){ for (ll i = 0; i<k; i++)pref[i]=positions[i]; for (ll i = k; i<n; i++)pref[i]=positions[i]+pref[i-k]; for (ll i = n-1; i>n-k-1; i--)suf[i]=l-positions[i]; for (ll i = n-k-1; i>=0; i--)suf[i]=l-positions[i]+suf[i+k]; ll ans=suf[0]; for (ll i = 0; i<n-1; i++)ans=min(ans,2*pref[i]+2*suf[i+1]); for (ll i = 0; i<n-1; i++)ans=min(ans,2*pref[i]+l+2*(i+k<n ? suf[i+k] : suf[n-1])); return ans; }

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

/usr/bin/ld: /tmp/ccoL3pyl.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status