[luoguP1578] 奶牛浴场(DP)


传送门

O(s2)算法

详见论文王知昆浅谈用极大化思想解决最大子矩形问题

我就复制你能把我怎么样QAQ

#include <cstdio> #include <iostream> #include <algorithm> #define N 5010 #define max(x, y) ((x) > (y) ? (x) : (y)) #define min(x, y) ((x) < (y) ? (x) : (y)) int L, W, n, ans; struct node p[N]; inline int read() inline bool cmp1(node a, node b) inline bool cmp2(node a, node b) int main() std::sort(p + 1, p + n + 1, cmp2); for(i = 1; i <= n; i++) else } } for(i = n; i >= 1; i) else } } printf("%d\n", ans); return 0; }

  



上一篇:[luoguP2679] 子串(DP)

下一篇:[luoguP1272] 重建道路


DP
Copyright © 2002-2019 k262电脑网 www.k262.cn 皖ICP备2020016292号
温馨提示:部分文章图片数据来源与网络,仅供参考!版权归原作者所有,如有侵权请联系删除!QQ:251442993 热门搜索 网站地图