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