Submission #213303

#TimeUsernameProblemLanguageResultExecution timeMemory
213303arman_ferdousBoxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; using ll = long long; long long delivery(int n, int k, int l, int p[]) { n = _n, k = _k, l = _l; ll dp1[n + 1], dp2[n + 1]; dp1[0] = dp2[0] = 0; for(int i = 1; i <= n; i++) { dp1[i] = 2ll * p[i - 1] + (i - k >= 0 ? dp1[i - k] : 0); dp2[i] = 2ll * (l - p[n - i]) + (i - k >= 0 ? dp2[i - k] : 0); } ll ans = 1e18; for(int i = 0; i <= n; i++) { ans = min(ans, dp1[i] + dp2[n - i]); if(n - i - k >= 0) ans = min(ans, dp1[i] + dp2[n - i - k] + l); } return ans; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:8:7: error: '_n' was not declared in this scope
   n = _n, k = _k, l = _l;
       ^~
boxes.cpp:8:7: note: suggested alternative: 'n'
   n = _n, k = _k, l = _l;
       ^~
       n
boxes.cpp:8:15: error: '_k' was not declared in this scope
   n = _n, k = _k, l = _l;
               ^~
boxes.cpp:8:15: note: suggested alternative: 'k'
   n = _n, k = _k, l = _l;
               ^~
               k
boxes.cpp:8:23: error: '_l' was not declared in this scope
   n = _n, k = _k, l = _l;
                       ^~
boxes.cpp:8:23: note: suggested alternative: 'l'
   n = _n, k = _k, l = _l;
                       ^~
                       l