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 "boxes.h"
#include <iostream>
using namespace std;
long long mini;
long long nclock[10000005];
long long cclock[10000005];
long long delivery(int n, int k, int l, int p[]) {
for(int i=0;i<n;i++){
if(i<k){
nclock[i] = min(p[i]*2,l);
}
else{
nclock[i] = nclock[i-k];
nclock[i] += min(p[i]*2,l);
}
}
for(int i=n-1;i>=0;i--){
if(i>=n-k){
cclock[i] = min((l-p[i])*2,l);
}
else{
cclock[i] = cclock[i+k];
cclock[i] += min((l-p[i])*2,l);
}
}
mini = cclock[0];
for(int i=0;i<n;i++){
mini = min(mini,nclock[i]+cclock[i+1]);
}
return mini;
}
# | 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... |