Submission #154117

#TimeUsernameProblemLanguageResultExecution timeMemory
154117mhy908Boxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include "boxes.h" #include <bits/stdc++.h> #define F first #define S second #define pb push_back #define llinf 8987654321987654321 #define inf 1987654321 using namespace std; typedef long long LL; typedef pair<int, int> pii; typedef pair<LL, LL> pll; LL dp2[10000010], dp[10000010], arr[10000010], ans=llinf; LL delivery(int n, int k, int l, int p[]) { for(int i=0; i<n; i++) arr[i+1]=p[i]; for(int i=1; i<=n; i++) dp[i]=dp[max(0, i-k)]+2*arr[i]; for(int i=n; i>0; i--) dp2[i]=dp2[min(n+1, i+k)]+2*(l-arr[i]); for(int i=0; i<=n; i++)ans=min(ans, dp[i]+dp2[i+1]); for(int i=0; i<=n-k; i++)ans=min(ans, dp[i]+dp2[i+k+1]+L); return ans; }

Compilation message (stderr)

boxes.cpp: In function 'LL delivery(int, int, int, int*)':
boxes.cpp:21:60: error: 'L' was not declared in this scope
     for(int i=0; i<=n-k; i++)ans=min(ans, dp[i]+dp2[i+k+1]+L);
                                                            ^