# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
404694 | Dakto | Boxes with souvenirs (IOI15_boxes) | C++17 | 6 ms | 332 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>
using namespace std;
int delivery(int n, int k, int l, int V[]){
vector<int> v(V, V+n);
v.erase(v.begin(),lower_bound(v.begin(),v.end(),1));
n=v.size();
vector<int> ps;
int c=0;
for(int i=0; i<n; i++){
ps.push_back(min(2*v[i], l)+c);
if((i-1)%k==0){
c+=min(2*v[i],l);
}
}
for(auto i:ps) cerr<<i<<endl;
int res=ps[n-1];
c=0;
int j=0;
for(int i=n-1; i>=0; i--, j++){
res=min(res,(i?ps[i-1]:0)+min(2*(l-v[i]), l)+c);
if((j-1)%k==0){
c+=min(2*(l-v[i]),l);
}
}
return res;
}
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... |