이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 = 1e18;
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;
}
| # | 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... |