Submission #64968

#TimeUsernameProblemLanguageResultExecution timeMemory
64968FedericoSShortcut (IOI16_shortcut)C++14
23 / 100
2048 ms1044 KiB
#include "shortcut.h" #include <algorithm> using namespace std; typedef long long int ll; int N; ll C; ll L[3005]; ll D[3005]; ll ans=1e18,res; long long find_shortcut(int N, std::vector<int> l, std::vector<int> d, int C) { for(int i=1;i<N;i++) L[i]=L[i-1]+l[i-1]; for(int i=0;i<N;i++) D[i]=d[i]; for(int i=0;i<N;i++) for(int j=i+1;j<N;j++){ res=0; for(int x=0;x<N;x++) for(int y=x+1;y<N;y++) res=max(res,min(L[y]-L[x],abs(L[x]-L[i])+abs(L[y]-L[j])+C)+D[x]+D[y]); ans=min(ans,res); } 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...