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 <cstdio>
#define N 1000001
int n,a[N],t[100][100];
long long s[N],q,mx;
int main ()
{
int i,j;
long long as;
scanf ("%d",&n);
for (i=1;i<=n;i++)
scanf ("%d",a+i),s[i]=s[i-1]+a[i];
for (i=1;i<=n;i++)
for (q=0,j=i;j>=1;j--)
{
q+=s[i]-s[j-1];
if (mx<q)
mx=q;
}
printf ("%lld\n",mx);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |