제출 #63320

#제출 시각아이디문제언어결과실행 시간메모리
63320hamzqq9선물상자 (IOI15_boxes)C++14
10 / 100
5 ms376 KiB
#include<bits/stdc++.h> #include "boxes.h" using namespace std; #define MAX 1000006 #define ll long long #define umin(x,y) x=min(x,y) #define umax(x,y) x=max(x,y) #define inf 100000000000000000 long long delivery(int N, int K, int L, int P[]) { ll ans1=0,ans2=0; for(int i=0;i<N;i+=K) { int last=min(N-1,i+K-1); ll cost=min(1ll*L,min(2ll*P[last],2ll*(L-P[i]))); ans1+=cost; } for(int i=N-1;i>=0;i-=K) { int last=max(0,i-K+1); ll cost=min(1ll*L,min(2ll*P[i],2ll*(L-P[last]))); ans2+=cost; } return min(ans1,ans2); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...