# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
254216 | eohomegrownapps | Boxes with souvenirs (IOI15_boxes) | C++14 | 1 ms | 256 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 "boxes.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll delivery(int n, int k, int l, int p[]) {
ll scoremin = 1e19;
ll scoretot = 0;
for (int i = 0; i<n; i+=k){
int s = i;
int e = min(i+k-1,n-1);
scoretot+=min(l,min((l-p[s])*2,p[e]*2));
}
//cout<<scoretot<<'\n';
scoremin=min(scoremin,scoretot);
scoretot=0;
for (int i = n-1; i>=0; i-=k){
int s = max(0,i-k+1);
int e = i;
scoretot+=min(l,min((l-p[s])*2,p[e]*2));
}
//cout<<scoretot<<'\n';
return scoretot;
}
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... |