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<bits/stdc++.h>
using namespace std;
const int maxn=10000010;
long long int l[maxn], r[maxn];
long long int delivery(int n, int cap, int tam, int pos[]){
for(int i=1; i<=n; i++){
l[i]=2*pos[i-1];
if(i>=cap+1) l[i]+=l[i-cap];
}
for(int i=1; i<=n; i++){
r[i]=2*(tam-pos[n-i]);
if(i>=cap+1) r[i]+=r[i-cap];
}
long long int resp=1123456789123456789;
for(int i=0; i<=n; i++){
resp=min(resp, l[i]+r[n-i]);
if(n-cap-i>=0) resp=min(resp, l[i]+r[n-cap-i]+tam);
}
return resp;
}
# | 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... |