Submission #31189

#TimeUsernameProblemLanguageResultExecution timeMemory
31189pasa3232Boxes with souvenirs (IOI15_boxes)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "boxes.h" using namespace std; typedef long long ll; ll n, k, l, data[10000010], lef[10000010], righ[10000010], ans; long long delivery(int N, int K, int L, int p[]) { n=N, k=K, l=L; for(int i=0; i<n; i++) data[i+1]=p[i]; for(ll i=1; i<=n; i++){ lef[i]=min(l, (data[i]*2); if(i>k) lef[i]+=lef[i-k]; } for(ll i=n; i>0; i--){ righ[i]=min(l, (l-data[i])*2); righ[i]+=righ[i+k]; } ans=min(lef[n], righ[1]); for(ll i=1; i<n; i++) ans=min(ans, lef[i]+righ[i+1]); return ans; }

Compilation message (stderr)

boxes.cpp: In function 'long long int delivery(int, int, int, int*)':
boxes.cpp:12:34: error: expected ')' before ';' token
         lef[i]=min(l, (data[i]*2);
                                  ^