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;
const int maxn=2e5+10;
long long delivery(int n, int K, int l, int p[])
{
long long ans=0;
int k=K;
for(int i=0;i<n;i++)
{
if(k==0)
{
k=K;
ans+=min(2*p[i-1],l);
}
k--;
}
if(k!=0)
ans+=min(2*p[n-1],l);
return ans;
}
# | 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... |