Submission #1091548

#TimeUsernameProblemLanguageResultExecution timeMemory
1091548triplem5dsBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
// #include "boxes.h" #include <bits/stdc++.h> long long cost1[10000007]; long long cost2[10000007]; using namespace std; long long delivery(int N, int K, int L, int p[]) { if(N == 1) return min(p[0], L - p[0]); for(int i = 0; i < K; i++) { long long cur1 = 0, cur2 = 0; for(int j = i; j < N; j+=K) { cur1 += min(p[j]*2,L); cur2 += min((L-p[N-1-j])*2,L); cost1[j] = cur1; cost2[j] = cur2; } } long long ans = min(cost1[N - 1], cost2[N - 1]); for(int i = 0; i < N - 1; i++) { ans = min(ans, cost1[i] + cost2[N-1-(i+1)]); } return ans; } int main() { int p[3] = {1,2,5}; cout << delivery(3,2,8,p); }

Compilation message (stderr)

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