# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15459 |
2015-07-12T08:02:22 Z |
jeapi |
달리는 게임 (kriii3_E) |
C++ |
|
5 ms |
5632 KB |
#include<iostream>
#include<algorithm>
using namespace std;
int D[1000][1000];
int M[1000];
int A[1000];
int main(){
int N;
int ans = 0;
cin >> N;
for (int i = 0; i < N; i++){
cin >> A[i];
}
for (int i = 0; i < N; i++){
for (int j = i; j < N; j++){
D[i][j] = D[i][j - 1] + (A[j] * (j - i + 1));
}
}
for (int i = 0; i < N; i++){
M[i] = D[0][i];
for (int j = 0; j <= i; j++){
M[i] = max(M[i], D[j][i] + M[j - 1]);
}
ans = max(M[i], ans);
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
5632 KB |
Output is correct |
2 |
Incorrect |
5 ms |
5632 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |