답안 #15498

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15498 2015-07-12T08:31:40 Z progressive 달리는 게임 (kriii3_E) C++14
26 / 70
2 ms 1104 KB
#include<cstdio>
#include<algorithm>
long long c[1500];
long long dp[1500];
int main()
{
	int N;
	scanf("%d",&N);
	for(int i=1;i<=N;i++)
		scanf("%lld",c+i);
	dp[N+1]=0;
	for(int i=N;i>=0;i--)
	{
		dp[i]=dp[i+1];
		long long inc=0;
		for(int j=i+1;j<=N+1;j++)
		{
			inc+=(j-i-1)*c[j-1];
			dp[i]=std::max(dp[j]+inc,dp[i]);
		}
	}
	printf("%lld",dp[0]);
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1104 KB Output is correct
2 Correct 0 ms 1104 KB Output is correct
3 Correct 0 ms 1104 KB Output is correct
4 Correct 0 ms 1104 KB Output is correct
5 Correct 2 ms 1104 KB Output is correct
6 Correct 2 ms 1104 KB Output is correct
7 Correct 0 ms 1104 KB Output is correct
8 Correct 2 ms 1104 KB Output is correct
9 Correct 2 ms 1104 KB Output is correct
10 Correct 2 ms 1104 KB Output is correct
11 Correct 2 ms 1104 KB Output is correct
12 Correct 2 ms 1104 KB Output is correct
13 Correct 0 ms 1104 KB Output is correct
14 Correct 2 ms 1104 KB Output is correct
15 Correct 0 ms 1104 KB Output is correct
16 Correct 0 ms 1104 KB Output is correct
17 Correct 2 ms 1104 KB Output is correct
18 Correct 0 ms 1104 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 1100 KB futex (syscall #202) was called by the program (disallowed syscall)
2 Halted 0 ms 0 KB -