# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
937623 | danikoynov | Boxes with souvenirs (IOI15_boxes) | C++14 | 1 ms | 2396 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
const int maxn = 1e7 + 10;
int n, k;
ll p[maxn], temp[maxn];
ll L;
ll get_price_left(int x)
{
ll res = 0;
int t = 0;
for (int i = 0; i < x; i ++)
{
//t ++;
//if (t == x || t % k == 0)
res = res + 2 * p[i];
}
return res;
}
ll get_price_right(int x)
{
ll res = 0;
int t = 0;
for (int i = n - 1; i >= n - x; i --)
{
//t ++;
//if (t == x || t % k == 0)
res = res + 2 * (L - p[i]);
}
return res;
}
long long delivery(int N, int K, int _L, int P[])
{
for (int i = 0; i < N; i ++)
p[i] = P[i];
n = N;
k = K;
L = _L;
//cout << get_price_right(1) << endl;
///exit(0);
ll res = inf;
for (int i = 0; i <= N; i ++)
{
ll val = get_price_left(i) + get_price_right(N - i);
//cout << i << " " << val << endl;
res = min(res, val);
//if (N - i - k >= 0)
//{
// val = get_price_left(i) + get_price_right(N - i - k) + L;
//res = min(res, val);
//}
}
return res;
}
컴파일 시 표준 에러 (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... |