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>
long long delivery(int numTeams, int capacity, int numSections, int p[])
{
std::vector<int64_t> timeL(numTeams);
std::vector<int64_t> timeR(numTeams);
for (int i = 0; i < numTeams; i++)
{
timeL[i] = std::min(p[i] * 2, numSections);
timeR[i] = std::min((numSections - p[i]) * 2, numSections);
}
for (int i = capacity + 1; i < numTeams; i++)
{
timeL[i] += timeL[i - capacity];
int ri = numTeams - i - 1;
timeR[ri] += timeR[ri + capacity];
}
int64_t t = INT64_MAX;
for (int i = 0; i < numTeams; i++)
{
t = std::min(t, timeL[i] + timeR[i]);
}
return t;
}
# | 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... |