
斜率优化dp
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
luogu 2900 土地购买
还是模拟队列看着清爽啊 #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long LL; const int maxn = 50005; int q[maxn]; LL w[maxn],h[maxn]; vector<pii> ve; ...原创 2019-08-26 20:10:16 · 171 阅读 · 0 评论 -
bzoj 1010: [HNOI2008]玩具装箱toy
斜率优化还是用浮点数的写法好写啊,以后就这么写了,还不会错(因为斜率相等的情况对于斜率优化是无所谓的,所以说浮点数误差不会导致错误) #include <bits/stdc++.h> using namespace std; typedef long long LL; const int maxn = 50005; int C[maxn],q[maxn]; LL sum[maxn]...原创 2019-08-26 21:30:54 · 136 阅读 · 0 评论