# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
160314 | model_code | Mean (info1cup19_mean) | C++17 | 4 ms | 504 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n,i,j,k,h,x,Max,a[204],d[204][204];
int main()
{
scanf ("%d", &n);
assert ((1<=n) && (n<=200));
for (i=1;i<=n;i++)
{
scanf ("%d", &a[i]);
assert ((1<=a[i]) && (a[i]<=1000000000));
}
for (i=1;i<=n;i++)
d[i][i]=a[i];
for (i=1;i<=(n-1);i++)
for (j=1;j<=(n-i);j++)
{
k=i+j;
Max=-2000000000;
for (h=j;h<=(k-1);h++)
{
x=d[j][h]+d[h+1][k];
x/=2;
if (x>Max)
Max=x;
}
d[j][k]=Max;
}
printf ("%d\n", Max);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |