Submission #531014

#TimeUsernameProblemLanguageResultExecution timeMemory
531014buidangnguyen05Boxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
/* input */ #include "boxes.h" #include<bits/stdc++.h> using namespace std; #define int long long typedef long long ll; const int N = 1e7 + 10; int f[N], g[N]; int delivery(int n, int k, int l, int a[]) { for (int i = 1; i <= n; ++i) f[i] = f[max(0LL, i - k)] + min(2 * a[i - 1], l); for (int i = n; i; --i) g[i] = g[min(n + 1, i + k)] + min(2 * (l - a[i - 1]), l); int res = 1e18; for (int i = 1; i <= n; ++i) res = min(res, f[i] + g[i + 1]); return res; }

Compilation message (stderr)

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