Submission #15196

# Submission time Handle Problem Language Result Execution time Memory
15196 2015-07-12T03:38:24 Z gs13068 달리는 게임 (kriii3_E) C++
0 / 70
0 ms 18444 KB
#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
1 Correct 0 ms 18444 KB Output is correct
2 Incorrect 0 ms 18444 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -