石子合并 四边形不等式优化
四边形不等式能够将动态规划中的许多问题时间复杂度简化,利用四边形不等式,我们可以更好的理解动态规划中的一些例子,下面是一个典型的题目:#include<bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
const int INF = 0x3f3f3f3f;int n;
int c[maxn], v[maxn], f[2][
原创
2016-08-06 16:05:55 ·
788 阅读 ·
0 评论