Submission #532025

#TimeUsernameProblemLanguageResultExecution timeMemory
532025nguyentunglamBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define forin(i, a, b) for(int i = a; i <= b; i++) #define forde(i, a, b) for(int i = a; i >= b; i--) #define fi first #define se second #define ll long long using namespace std; const int N = 1e7 + 10; int a[N], dp[2][N]; int res = 1e9; int main() { int n, k, l; cin >> n >> k >> l; forin(i, 1, n) cin >> a[i]; forin(i, 1, n) dp[0][i] = dp[0][max(0, i-k)] + a[i] + min(a[i], l-a[i]); forde(i, n, 1) dp[1][i] = dp[1][min(n+1, i+k)] + l-a[i] + min(a[i], l - a[i]); forin(i, 1, n+1) res = min(res, dp[0][i-1] + dp[1][i]); //forde(i, n, 1) cout << dp[1][i]<<" "; cout << res; }

Compilation message (stderr)

/usr/bin/ld: /tmp/cc0OEixn.o: in function `main':
grader.c:(.text.startup+0x0): multiple definition of `main'; /tmp/cconbPQn.o:boxes.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc0OEixn.o: in function `main':
grader.c:(.text.startup+0x1ef): undefined reference to `delivery(int, int, int, int*)'
collect2: error: ld returned 1 exit status