| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1333158 | kawhiet | 선물상자 (IOI15_boxes) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
long long delivery(int n, int k, int len, int p[]) {
vector<int> pos(n);
for (int i = 0; i < n; i++) {
pos[i] = p[i];
}
n = pos.size();
deque<int> l, r;
for (int i = 0; i < n; i++) {
if (pos[i] <= len / 2) {
l.push_back(pos[i]);
} else {
r.push_back(len - pos[i]);
}
}
ranges::reverse(r);
long long ans = 0;
if (!l.empty()) ans += l.back() * 2;
if (!r.empty()) ans += r.back() * 2;
return min(ans, (long long)len);
}| # | 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... | ||||
