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"
long long min(long long a, long long b)
{
return (a < b)?a:b;
}
long long delivery(int N, int K, int L, int p[]) {
long long r = 0;
int i;
long long mn, mx;
for (i = 0; i < N; i += K)
{
mn = p[i];
mx = p[min(i + K, N) - 1];
r += min(L, min(mx, L - mn)*2LL);
}
return r;
}
# | 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... |