Submission #557583

#TimeUsernameProblemLanguageResultExecution timeMemory
557583Ai7081Boxes with souvenirs (IOI15_boxes)C++17
0 / 100
1 ms316 KiB
#include "boxes.h" #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 1e7+5; const ll inf = 1e18; ll dp1[N], dp2[N], ans=inf; ll delivery(int n, int k, int L, int pos[]) { for (int i=0; i<n; i++) dp1[i] = (ll)2*pos[i] + (i>=k ? dp1[i-k] : 0); for (int i=n-1; i>=0; i--) dp2[i] = (ll)2*(L-pos[i]) + (i<n-k ? dp2[i+k] : 0); for (int i=0; i<n-1; i++) ans = min(ans, dp1[i] + dp2[i+1]); return ans; }
#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...