| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 621215 | M_W | 선물상자 (IOI15_boxes) | C++17 | 1 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "boxes.h"
using namespace std;
long long delivery(int N, int K, int L, int p[]) {
int cnt = 1, mid = (L + 1) >> 1;
long long ans = 0;
int st = 0;
for(int i = 0; i < N; i++){
if(cnt > K){
int ed = p[i - 1]; ans += (ed - st) * 1ll;
if(st <= mid) ans += (st * 1ll);
else ans += ((L - st) * 1ll);
if(ed <= mid) ans += (ed * 1ll);
else ans += ((L - ed) * 1ll);
cnt = 1; st = p[i];
}
cnt++;
}
int ed = p[N - 1]; ans += (ed - st) * 1ll;
if(st <= mid) ans += (st * 1ll); else ans += ((L - st) * 1ll);
if(ed <= mid) ans += (ed * 1ll); else ans += ((L - ed) * 1ll);
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... | ||||
