제출 #621940

#제출 시각아이디문제언어결과실행 시간메모리
621940Deepesson선물상자 (IOI15_boxes)C++17
50 / 100
2094 ms11964 KiB
#include <bits/stdc++.h> long long delivery(int N, int K, int L, int p[]); using ll = long long; ll inf = 1LL<<60LL; long long delivery(int N, int K, int L, int p[]) { ll dp[N+1]; for(auto&x:dp)x=inf; dp[0]=0; for(int i=0;i!=N;++i){ int c=0; for(int j=i;j!=-1;--j){ ++c; dp[i+1]=std::min(dp[i+1],dp[j]+std::min({(ll)L,(ll)2*p[i],(ll)2*L-2*p[j]})); if(c==K)break; } } 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...