Submission #889178

#TimeUsernameProblemLanguageResultExecution timeMemory
889178Sir_Ahmed_ImranShortcut (IOI16_shortcut)C++17
23 / 100
2067 ms600 KiB
///~~~LOTA~~~/// #include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define ll long long ll x[500]; ll dist(int v,int u){ if(u<v) swap(u,v); return x[u]-x[v]; } ll find_shortcut(int n,vector<int> l,vector<int> d,int c){ ll o,r,s; x[0]=d[0]; for(int i=0;i<n-1;i++) x[i+1]=x[i]+l[i]; o=1e18; for(int i=0;i<n;i++){ for(int j=i+1;j<n;j++){ for(int p=r=0;p<n;p++){ for(int q=p+1;q<n;q++){ s=min(dist(p,i)+dist(q,j),dist(p,j)+dist(q,i))+c; s=min(s,dist(p,q)); r=max(r,s+d[p]+d[q]); } } o=min(o,r); } } return o; }
#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...