제출 #764185

#제출 시각아이디문제언어결과실행 시간메모리
764185SanguineChameleon선물상자 (IOI15_boxes)C++17
50 / 100
2025 ms20712 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; const long long inf = 1e18L + 20; const int maxN = 1e7 + 20; int A[maxN]; long long dp[maxN]; long long delivery(int N, int K, int L, int P[]) { for (int i = 1; i <= N; i++) { A[i] = P[i - 1]; } for (int i = 1; i <= N; i++) { dp[i] = inf; for (int j = 1; j <= min(i, K); j++) { dp[i] = min(dp[i], dp[i - j] + min(min(A[i] * 2, (L - A[i - j + 1]) * 2), L)); } } 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...