Submission #284894

#TimeUsernameProblemLanguageResultExecution timeMemory
284894wildturtleDischarging (NOI20_discharging)C++14
9 / 100
429 ms9592 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,i,e,f,g,n,m,k,l,A[500005],minn,maxx; int main() { cin>>n; for(long long i=1;i<=n;i++) { cin>>A[i]; } if(n==1) { cout<<A[1]; return 0; } if(n==2) { cout<<min(A[1]+A[1]+A[2],2*max(A[1],A[2])); return 0; } if(n==3) { a=A[1]+A[1]+A[2]+A[1]+A[2]+A[3]; b=2*max(A[1],A[2])+max(A[1],A[2])+A[3]; d=A[1]+2*(max(A[2],A[3])+A[1]); c=3*max(A[1],max(A[2],A[3])); cout<<min(min(a,b),min(c,d)); return 0; } cout<<A[1]*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...