摘要:
原题链接 思路 求最大区间和 \(\to\) 设每个点为区间右端点时的最大区间和 \(f[i]\) ,则答案一定为 \(max(f[i])\) \(\to\) 求最大的 \(f[i]\) \(\to\) 每个 \(f[i]=max(sum[i]-sum[j-1]),j\in[i-k+1,i]\) \ 阅读全文
posted @ 2024-03-09 21:52
纯粹的
阅读(21)
评论(0)
推荐(0)
摘要:
原题链接 题解 太巧妙了!! code #include<bits/stdc++.h> using namespace std; int main() { int n,w; cin>>n>>w; int score[605]={0}; for(int i=1;i<=n;i++) { int x; c 阅读全文
posted @ 2024-03-09 19:15
纯粹的
阅读(73)
评论(0)
推荐(0)
摘要:
原题链接 题解 不能连续选k个元素 \(\to\) 任意每k个元素就有一个不选 \(\to\) 每k个点就有一个断点 \(\to\) 每个点都有可能是断点 \(\to\) dp求解 \(sol.1\) 令 \(f[i]\) 为第i个点为断点且为结尾的最大值 则 \(f[i]=max(f[j]+sum 阅读全文
posted @ 2024-03-09 16:40
纯粹的
阅读(41)
评论(0)
推荐(0)

浙公网安备 33010602011771号