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>
#include <utility>
#include <algorithm>
using namespace std;
long long delivery(int N, int K, int L, int p[])
{
long long res = 0; int i = 0;
for (; i < N && p[i] == 0; i++);
for (;i < N; i += K)
{
res += min({L, 2 * p[min(N - 1, i + K - 1)], 2 * (L - p[i])});
}
return res;
}
# | 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... |