Submission #284896

# Submission time Handle Problem Language Result Execution time Memory
284896 2020-08-28T07:49:46 Z wildturtle Discharging (NOI20_discharging) C++14
20 / 100
893 ms 17912 KB
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d,i,e,f,g,n,m,k,l,A[1000005],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 time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 0 ms 384 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 837 ms 8784 KB Output is correct
2 Correct 846 ms 17756 KB Output is correct
3 Correct 835 ms 17800 KB Output is correct
4 Correct 835 ms 17876 KB Output is correct
5 Correct 842 ms 17912 KB Output is correct
6 Correct 893 ms 17912 KB Output is correct
7 Correct 843 ms 17912 KB Output is correct
8 Correct 829 ms 17912 KB Output is correct
9 Correct 830 ms 17784 KB Output is correct
10 Correct 827 ms 17856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 0 ms 384 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Incorrect 2 ms 384 KB Output isn't correct
16 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 0 ms 384 KB Output is correct
12 Correct 0 ms 256 KB Output is correct
13 Correct 0 ms 256 KB Output is correct
14 Correct 0 ms 256 KB Output is correct
15 Incorrect 2 ms 384 KB Output isn't correct
16 Halted 0 ms 0 KB -