제출 #557584

#제출 시각아이디문제언어결과실행 시간메모리
557584Ai7081선물상자 (IOI15_boxes)C++17
0 / 100
1 ms340 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 1e7+5; const ll inf = 1e18; ll dp1[N], dp2[N], ans=inf; ll delivery(int n, int k, int L, int pos[]) { for (int i=0; i<n; i++) dp1[i] = (ll)2*pos[i] + (i>=k ? dp1[i-k] : (ll)0); for (int i=n-1; i>=0; i--) dp2[i] = (ll)2*(L-pos[i]) + (i<n-k ? dp2[i+k] : (ll)0); for (int i=0; i<n-1; i++) ans = min(ans, dp1[i] + dp2[i+1]); return ans; }
#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...