# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
409759 | radaiosm7 | 선물상자 (IOI15_boxes) | C++98 | 583 ms | 243528 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#include "boxes.h"
long long dp[2][10000005];
int n, i;
long long ans;
long long delivery(int n, int k, int l, int p[]) {
dp[0][0] = 0LL;
dp[1][n+1] = 0LL;
ans = LONG_LONG_MAX;
for (i=1; i <= n; ++i) {
dp[0][i] = 0LL;
dp[0][i] = dp[0][i-(i-k>=0)*k]+min(2LL*p[i-1], 1LL*l);
}
for (i=n; i >= 1; --i) {
dp[1][i] = 0LL;
dp[1][i] = dp[1][i+(i+k<=n)*k]+min(2LL*(l-p[i-1]), 1LL*l);
}
for (i=0; i <= n; ++i) {
ans = min(ans, dp[0][i]+dp[1][i+1]);
}
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... |