제출 #519587

#제출 시각아이디문제언어결과실행 시간메모리
519587silverfish선물상자 (IOI15_boxes)C++17
50 / 100
2073 ms12124 KiB
#include <bits/stdc++.h> #include "boxes.h" using namespace std; using ll = long long; const int N = 1000006; ll dp[N]; long long delivery(int n, int k, int L, int p[]) { ll l = L; fill(dp, dp+n+1, 1LL*n*l); dp[0] = 0; for(int i = 1; i <= n; ++i){ ll mn = min(l, 2LL*p[i-1]); for(int j = i; j > max(i-k, 0); --j){ ll cmn = min(mn, 2LL*(l-p[j-1])); dp[i] = min(dp[i], dp[j-1] + cmn); } } return dp[n]; }
#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...