# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1119222 | Newtonabc | 선물상자 (IOI15_boxes) | C++14 | 2 ms | 2644 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include<bits/stdc++.h>
using namespace std;
const int N=1e7+10;
long long dpa[N],dpb[N];
int n,k,l;
long long delivery(int N, int K, int L, int p[]) {
n=N,k=K,l=L;
for(int i=0;i<n;i++){
int j=n-i-1;
if(i-k>=0) dpa[i]=dpa[i-k]+2LL*(long long)p[i];
else dpa[i]=2LL*(long long)p[i];
if(j+k<n) dpb[j]=dpb[j+k]+2LL*(long long)(l-p[j]);
else dpb[j]=2LL*(long long)(l-p[j]);
}
long long ans=min(dpa[n-1],dpb[0]);
for(int i=0;i+k-1<n;i++){
int j=i+k-1;
ans=min(ans,(i-1>=0?dpa[i-1]:0LL)+l+(j+1<n?dpb[j+1]:0LL));
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |