| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1336184 | Andrey | Bigger segments (IZhO19_segments) | C++20 | 1592 ms | 2628 KiB |
#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long n;
cin >> n;
vector<long long> haha(n+1);
for(long long i = 1; i <= n; i++) {
cin >> haha[i];
}
vector<pair<long long,long long>> dp(n+1);
for(long long i = 1; i <= n; i++) {
long long sb = 0;
for(long long j = i; j >= 1; j--) {
sb+=haha[j];
if(-dp[j-1].second <= sb) {
dp[i] = max(dp[i],{dp[j-1].first+1,-sb});
}
}
}
cout << dp[n].first;
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... | ||||
