이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include<bits/stdc++.h>
using namespace std;
class pont{
public:
	int elotte;
	int utana;
	int hely;
	
	long long vissza;
	
	long long elolrol;
	long long hatulrol;
};
vector<pont> p;
long long delivery(int n, int k, int l, int in[]) {
	p.resize(n+1);
	for(int i=0;i<=n;i++){
		p[i].elotte = (i-1+n+1)%(n+1);
		p[i].utana = (i+1)%(n+1);
	}
	p[0].hely=0;
	for(int i=1;i<=n;i++){
		p[i].hely=in[i-1];
	}
	long long eddig=0; 
	for(int i=1;i<=n;i++){
		if((i-1)%k==0){
			eddig+=p[i].hely;
		} else {
			eddig+=p[i].hely-p[p[i].elotte].hely;
		}
		p[i].elolrol=eddig;
		p[i].vissza= min (
			p[i].hely, l-p[i].hely
		);
	}
	eddig=0;
	p[0].hely=l;
	for(int i=n;i>0;i--){
		if((n-i)%k==0){
			eddig+=l-p[i].hely;
		} else {
			eddig+=p[p[i].utana].hely-p[i].hely;
		}
		p[i].hatulrol=eddig;
	}
	long long mn= LLONG_MAX;
	for(int i=0;i<=n;i++){
		mn = min(p[p[i].utana].vissza+p[i].vissza+p[i].elolrol+p[p[i].utana].hatulrol,mn);
	}
return mn;
}
| # | 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... |