Submission #15304

# Submission time Handle Problem Language Result Execution time Memory
15304 2015-07-12T05:32:58 Z sujin 달리는 게임 (kriii3_E) C++
0 / 70
0 ms 12840 KB
#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<=n;j++)
		{
			q+=a[j]*(j-i+1);
			if (mx<q)
				mx=q;
		}
	


	printf ("%lld\n",mx);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 12840 KB Output is correct
2 Incorrect 0 ms 12840 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -