- 博客(4)
- 收藏
- 关注
原创 【DP】 BZOJ 3437: 小P的牧场
斜率优化一下就行了。。。 #include using namespace std; typedef long long LL; const int maxn = 1000005; LL a[maxn], H[maxn], s[maxn], f[maxn]; int q[maxn], n, m; LL getfz(int j2, int j1) { return f[j1] - f[j
2015-11-09 19:46:02 881
原创 【DP】 BZOJ 3675: [Apio2014]序列分割
推出公式以后就可以斜率dp优化了。。。 #include using namespace std; typedef long long LL; const int maxn = 100005; LL t1[maxn], t2[maxn]; LL s[maxn]; LL *f, *g; int q[maxn]; int n, m; LL getfz(int j2, int j1) { r
2015-11-06 21:28:07 562
原创 【DP】 HDOJ 3507 Print Article
斜率dp水题。。。 #include using namespace std; typedef long long LL; const int maxn = 500005; int f[maxn]; int s[maxn]; int q[maxn]; int n, m; int getfz(int j2, int j1) { return (f[j1] + s[j1] * s[j1])
2015-11-06 20:31:30 561
原创 【DP】 cf 321E
用四边形优化一下dp即可。。。。 #include using namespace std; typedef long long LL; const int maxm = 808; const int maxn = 4004; const int INF = 0x3f3f3f3f; int f[maxm][maxn]; int s[maxm][maxn]; int a[maxn][maxn
2015-11-02 14:18:04 502
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人