
最大子段和
zafkiel_nightmare
弱弱的程序员
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1231 最大连续子序列
状态:f[i]:以i为结尾最长连续序列状态转移:f[i]=max{f[i-1]+rem[i],rem[i]}初始状态:f[0]=rem[0];#include #define maxn 10000+5 using namespace std; int rem[maxn]; int f[maxn]; int st[maxn]; int main() { cin.sync_with_stdio(fa原创 2015-04-24 19:45:00 · 496 阅读 · 0 评论 -
hdu 1081 To The Max
最大子矩阵和,原来好像在哪里做过,忘了,将二维压缩成一维,然后最大子段和搞定 #include #include #define maxn 105 using namespace std; int n,f[maxn][maxn],sum[maxn][maxn],a[maxn],re; void input() { memset(sum,0,sizeof(sum)); re=-1<<30;原创 2016-04-06 22:28:15 · 243 阅读 · 0 评论