| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1336307 | aaaaaaaa | Bigger segments (IZhO19_segments) | C++20 | 1589 ms | 468 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int inf = 2e18;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(nullptr); cout.tie(nullptr);
int n, ans = 0;
cin >> n;
vector<int> a(n + 1, 0);
for(int i = 1; i <= n; ++i){
cin >> a[i];
}
vector<int> pdp(n + 1, inf);
pdp[0] = 0;
for(int k = 1; k <= n; ++k){
vector<int> ndp(n + 2, inf);
for(int i = 1; i <= n; ++i){
for(int j = i, s = 0; j >= 1; --j){
s += a[j];
if(s >= pdp[j - 1]){
ndp[i] = s;
break;
}
}
if(ndp[i] < inf) ans = max(ans, k);
}
swap(ndp, pdp);
}
cout << ans << "\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... | ||||
