#include "boxes.h"
#include<bits/stdc++.h>
using namespace std;
long long delivery(int n, int k, int L, int p[]) {
int Ans=1e9, l[n], r[n];
memset (l, 0, sizeof(l));
memset (r, 0, sizeof(r));
for (int i=1; i<=n; i++)r[i]=r[max(i-k,0)]+p[i-1]*2,l[i]=l[max(i-k,0)]+(L-p[i-1])*2;
for (int i=0; i<=n; i++)Ans=min(Ans, min(l[i]+r[n-i], l[i]+r[max(n-i-k, 0)]+L));
return Ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |