제출 #621882

#제출 시각아이디문제언어결과실행 시간메모리
621882Deepesson선물상자 (IOI15_boxes)C++17
50 / 100
2007 ms21716 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+1;j!=0;--j){ ++c; //std::cout<<"Custo "<<i<<" "<<j<<" "<<dp[j-1]+std::min({(ll)L,(ll)2*p[i],(ll)2*L-2*p[i]})<<"\n"; dp[i+1]=std::min(dp[i+1],dp[j-1]+std::min({(ll)L,(ll)2*p[i],(ll)2*L-2*p[j-1]})); if(c==K)break; } // std::cout<<"Custo "<<dp[i+1]<<"\n"; } 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...