답안 #330336

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
330336 2020-11-24T20:04:33 Z jungsnow Feast (NOI19_feast) C++14
41 / 100
36 ms 59116 KB
#include<bits/stdc++.h>
#define x first
#define y second

using namespace std;
using ll = long long;

const int maxn = 2100;

int N, K, A[maxn];
ll Dp[maxn][maxn][2];

int main() {
//    freopen("feast.inp", "r", stdin);
//    freopen("feast.out", "w", stdout);
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> N >> K;
    for (int i = 1; i <= N; ++i)
        cin >> A[i];
    Dp[0][0][0] = 0;
    for (int i = 1; i <= N; ++i) {
        Dp[i][0][0] = 0;
        for (int j = 1; j <= K; ++j) {
            Dp[i][j][1] = max(Dp[i - 1][j][1], Dp[i - 1][j - 1][0]) + A[i];
            Dp[i][j][0] = max(Dp[i - 1][j][1], Dp[i - 1][j][0]);
        }
    }
    cout << max(Dp[N][K][0], Dp[N][K][1]);
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 748 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 10348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 756 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 620 KB Output is correct
2 Correct 1 ms 748 KB Output is correct
3 Correct 1 ms 620 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 620 KB Output is correct
6 Correct 1 ms 748 KB Output is correct
7 Correct 1 ms 620 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 620 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 620 KB Output is correct
2 Correct 1 ms 748 KB Output is correct
3 Correct 1 ms 620 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 620 KB Output is correct
6 Correct 1 ms 748 KB Output is correct
7 Correct 1 ms 620 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 620 KB Output is correct
11 Correct 1 ms 1772 KB Output is correct
12 Correct 1 ms 1644 KB Output is correct
13 Correct 1 ms 1516 KB Output is correct
14 Correct 1 ms 1644 KB Output is correct
15 Correct 1 ms 1644 KB Output is correct
16 Correct 1 ms 1516 KB Output is correct
17 Correct 1 ms 1772 KB Output is correct
18 Correct 1 ms 1516 KB Output is correct
19 Correct 1 ms 1516 KB Output is correct
20 Correct 1 ms 1516 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 620 KB Output is correct
2 Correct 1 ms 748 KB Output is correct
3 Correct 1 ms 620 KB Output is correct
4 Correct 1 ms 620 KB Output is correct
5 Correct 1 ms 620 KB Output is correct
6 Correct 1 ms 748 KB Output is correct
7 Correct 1 ms 620 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 620 KB Output is correct
11 Correct 1 ms 1772 KB Output is correct
12 Correct 1 ms 1644 KB Output is correct
13 Correct 1 ms 1516 KB Output is correct
14 Correct 1 ms 1644 KB Output is correct
15 Correct 1 ms 1644 KB Output is correct
16 Correct 1 ms 1516 KB Output is correct
17 Correct 1 ms 1772 KB Output is correct
18 Correct 1 ms 1516 KB Output is correct
19 Correct 1 ms 1516 KB Output is correct
20 Correct 1 ms 1516 KB Output is correct
21 Correct 8 ms 14316 KB Output is correct
22 Correct 36 ms 59116 KB Output is correct
23 Correct 14 ms 19948 KB Output is correct
24 Correct 9 ms 14828 KB Output is correct
25 Correct 11 ms 17644 KB Output is correct
26 Correct 8 ms 13804 KB Output is correct
27 Correct 10 ms 17132 KB Output is correct
28 Correct 5 ms 9452 KB Output is correct
29 Correct 5 ms 9196 KB Output is correct
30 Correct 5 ms 8300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 5 ms 748 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -