上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页
摘要: 留坑(p.254) 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 void setIO(const string& s) {10 freopen((s + ".in"... 阅读全文
posted @ 2016-01-03 21:16 Showson 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 填坑系列(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) 编辑
摘要: 留坑为什么别人家的斜率优化跟我一点都不一样!为什么斜率都要变成正的。。。为什么要那么推式子为什么不能直接做啊。。。。。为什么不把0去掉去秒WA啊为什么叉积去了0也过不了啊woc啊 1 #include 2 #include 3 #include 4 #include 5 #include ... 阅读全文
posted @ 2015-12-30 21:33 Showson 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 窝只是来留坑的qwq 为毛别人家的乘积式可以过? updated2016.3.23 把向量判断的又写了一遍 就过了 阅读全文
posted @ 2015-12-30 11:48 Showson 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 填坑系列考虑所有经过两个点的直线,一定有最优解。再考虑确定一个点,按极角顺序枚举所有直线,从而O(1)转移信息。还有代码实现技巧 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 const int N = 1000 + 10; ... 阅读全文
posted @ 2015-12-29 09:34 Showson 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 填坑系列(p.172)注意“可以旋转和翻转”然后将每个字母看成点不然边数就是n^2级的 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 void setIO(const str... 阅读全文
posted @ 2015-12-27 22:26 Showson 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 填坑系列(p.171)orz rjl代码基本和rjl的一样 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 template Q read(Q& x) { 8 static char c, f; 9 ... 阅读全文
posted @ 2015-12-27 21:53 Showson 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 这里给出了统计有效子串以及确定其第一次出现位置的方式 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 using namespace std; 8 9 void setIO(const string& s) ... 阅读全文
posted @ 2015-12-27 20:23 Showson 阅读(151) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 14 下一页