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>
#include<algorithm>
long long a[1111111];
long long d[1111111];
int main()
{
long long max=0,s=0;
int i,n;
scanf("%d",&n);
for(i=1;i<=n;i++)scanf("%lld",&a[i]);
for(i=n;i>=1;i--)
{
s+=a[i];
d[i]=d[i+1]+s;
max=std::max(max,d[i]);
}
printf("%lld\n",max);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |