摘要: 填坑系列(p.248)比较神从两端枚举最坏复杂度就成O(nlogn)了 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 8 using namespace std; 9 10 void setIO(const ... 阅读全文
posted @ 2015-12-31 11:36 Showson 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 看网上的斜率优化都比较玄。。。gerw给出了一种比较好的理解方式简单的有两种形式一、形如dp(i) = min / max {f(j) + g(i) * h(j) + c(i)} (j < i) //h() 一般是有单调性的显然c(i)是可以拿出来的,就变成了dp(i) = min / max {f... 阅读全文
posted @ 2015-12-31 09:25 Showson 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 填坑系列(p.246)由函数连续性得满足二分性 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 void setIO(const string& s) {10 freo... 阅读全文
posted @ 2015-12-31 09:07 Showson 阅读(237) 评论(0) 推荐(0) 编辑