이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "boxes.h"
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rt insert
#define st first
#define nd second
#define ll long long
#define pii pair < int , int >
#define DB printf("debug\n");
#define umax( x , y ) x = max( x , (y) )
#define umin( x , y ) x = min( x , (y) )
#define all(x) x.begin() , x.end()
#define MAXN 10000005
using namespace std;
ll art[MAXN];
ll azl[MAXN];
long long delivery(int N, int K, int L, int p[]) {
ll ans=1e18;
for(int i=0;i<N;i++){
if(i<K)art[i]=2*p[i];
else art[i]=art[i-K]+2*p[i];
}
for(int i=N-1;i>=0;i--){
if(N-1-i<K)azl[i]=2*(L-p[i]);
else azl[i]=azl[i+K]+2*(L-p[i]);
}
umin(ans,art[0]+azl[1]);
for(int i=0;i<N;i++){
umin(ans,art[i-1]+azl[i]);
}
cout<<ans<<endl;
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... |