| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 432411 | snasibov05 | 선물상자 (IOI15_boxes) | C++14 | 621 ms | 220976 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define oo 1000000000000000000ll
long long delivery(int n, int k, int l, int p[]) {
vector<ll> pref(n), suf(n+1);
for (int i = 0; i < n; ++i) {
if (i - k >= 0) pref[i] = pref[i-k];
pref[i] += min(2ll*p[i], 1ll*l);
}
for (int i = n-1; i >= 0; --i) {
if (i + k < n) suf[i] = suf[i+k];
suf[i] += min(2ll*(l - p[i]), 1ll*l);
}
ll ans = suf[0];
for (int i = 0; i < n; ++i) {
ans = min(ans, pref[i] + suf[i+1]);
}
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... | ||||
