Submission #107488

#TimeUsernameProblemLanguageResultExecution timeMemory
107488pedro_sponchiadoBoxes with souvenirs (IOI15_boxes)C++17
100 / 100
531 ms196600 KiB
#include "boxes.h" #include<bits/stdc++.h> using namespace std; const int maxn=10000010; long long int l[maxn], r[maxn]; long long int delivery(int n, int cap, int tam, int pos[]){ for(int i=1; i<=n; i++){ l[i]=2*pos[i-1]; if(i>=cap+1) l[i]+=l[i-cap]; } for(int i=1; i<=n; i++){ r[i]=2*(tam-pos[n-i]); if(i>=cap+1) r[i]+=r[i-cap]; } long long int resp=1123456789123456789; for(int i=0; i<=n; i++){ resp=min(resp, l[i]+r[n-i]); if(n-cap-i>=0) resp=min(resp, l[i]+r[n-cap-i]+tam); } return resp; }
#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...