摘要: Code: 阅读全文
posted @ 2018-09-19 20:55 EM-LGH 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 真的毫无算法可言,就是比谁的码力强罢了... Code: 阅读全文
posted @ 2018-09-19 20:46 EM-LGH 阅读(175) 评论(0) 推荐(0) 编辑
摘要: 1.注意在 split 和 merge时要特判一下边界, 否则就会出现边界错误的情况。 2.随时都要维护父指针。 3.在更新 maxv 和翻转标记时要判一下左右儿子是否都存在。 阅读全文
posted @ 2018-09-18 12:44 EM-LGH 阅读(215) 评论(0) 推荐(1) 编辑
摘要: Code:#include#include#includeusing namespace std;const int maxn = 200000 + 4;const int logn = 19;int F[30][maxn], dep[maxn];inlin... 阅读全文
posted @ 2018-09-17 19:25 EM-LGH 阅读(221) 评论(0) 推荐(1) 编辑
摘要: 如此之裸…Code:#include#include#include#includeusing namespace std;const int maxn = 200000 + 3;int x[maxn], y[maxn], n, m, len;long lo... 阅读全文
posted @ 2018-09-17 19:10 EM-LGH 阅读(326) 评论(0) 推荐(1) 编辑
摘要: Code:#include#include#includeusing namespace std;const int maxn = 1000000 + 233;const long long N = 1000000000000000000;long long... 阅读全文
posted @ 2018-09-17 18:48 EM-LGH 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 裸题,注意队列下标不要写错 Code: 阅读全文
posted @ 2018-09-13 19:43 EM-LGH 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 复习一下斜率优化: 令 $f_{i}$ 表示从 1 考虑到 $i$ 的最优结果. 得 $f_{i}=min${ $f_{j}+(sum_{i}-sum_{j}+i-j-1-L)^{2}$} 如果直接枚举,是 $O(n^{2})$ 的,太慢了!!!考虑斜率优化: 令 $k<j$,考虑什么时候 $j$ 阅读全文
posted @ 2018-09-12 20:30 EM-LGH 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 首先,我们不难发现N个位置都选一定不会比少选任意几个差,所以我们就先设定我们将这N个修改机会都用上, 那么如果点 i">ii 前有sumv">sumvsumv个可修改点要被选的话,当前点被选择的条件是减掉sumv">sumvsumv后依然能和前面已减掉过su... 阅读全文
posted @ 2018-09-10 23:52 EM-LGH 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 十分有趣的一道题目 Code:#include#include#includeusing namespace std;const int N=200;const int maxn=100000+2;stackS;int head[N],to[maxn],ne... 阅读全文
posted @ 2018-09-09 15:23 EM-LGH 阅读(128) 评论(0) 推荐(0) 编辑