# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31194 | pasa3232 | Boxes with souvenirs (IOI15_boxes) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "boxes.h"
using namespace std;
typedef long long ll;
ll n, k, l, A[10000010], D[10000010], R[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++){
A[i]=p[i];
if(A[i] == 0) n--, A[i]=p[i];
D[i]=(i<k?0:D[i-k])+min(l,A[i]*2);
}
ans=D[n-1];
for(int i=n-1;i>=0;i--){
R[i]=(i+k<n?R[i+k]:0)+(l-A[i])*2;
ans=min(ans,R[i]+(i?D[i-1]:0));
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |