| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1309701 | aaaaaaaa | Feast (NOI19_feast) | C++20 | 1097 ms | 327680 KiB |
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int n, k;
cin >> n >> k;
vector<int> a(n + 1, 0);
vector<vector<int>> dp(n + 5, vector<int>(k + 5, 0));
for(int i = 1; i <= n; ++i){
cin >> a[i];
}
for(int i = 1; i <= n; ++i){
for(int j = 1; j <= k; ++j){
dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - 1]);
for(int x = i, s = 0; x >= 1; --x){
s += a[x];
dp[i][j] = max(dp[i][j], s + dp[x - 1][j - 1]);
}
}
}
cout << dp[n][k] << "\n";
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
