제출 #531021

#제출 시각아이디문제언어결과실행 시간메모리
531021buidangnguyen05선물상자 (IOI15_boxes)C++17
100 / 100
436 ms196428 KiB
/* input */ #include "boxes.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e7 + 10; ll f[N], g[N]; ll delivery(int n, int k, int l, int a[]) { for (int i = 1; i <= n; ++i) f[i] = f[max(0, i - k)] + min(2 * a[i - 1], l); ll res = 1e18; for (int i = n; i; --i) { g[i] = g[min(n + 1, i + k)] + min(2 * (l - a[i - 1]), l); res = min(res, f[i - 1] + g[i]); } return min(res, f[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...