上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 36 下一页
摘要: ```cpp include include include include using namespace std; int n, m, a[50005], blc, bel[50005], cnt[50005]; long long ansfz[50005], ansfm[50005], ans 阅读全文
posted @ 2018-03-01 16:21 poorpool 阅读(153) 评论(0) 推荐(0)
摘要: 算法竞赛进阶指南p219,这里是分块。 当然也可以树套树来个动态二维数点。 cpp include include include include include using namespace std; typedef long long ll; int xx, yy, n, uu, vv, bl 阅读全文
posted @ 2018-02-28 20:52 poorpool 阅读(189) 评论(0) 推荐(0)
摘要: ```cpp #include #include #include #include #include #include #include using namespace std; int n, m, bel[40005], a[40005], blc, f[1005][1005], cnt[40005], idx, ans; int val[40005], uu, vv; map ... 阅读全文
posted @ 2018-02-28 13:54 poorpool 阅读(165) 评论(0) 推荐(0)
摘要: 大凡两个标记,无非是先乘再加,与先加再乘的区别罢了。 先加再乘 我们以 $val$ 来表示这个结点原始的值,$add$ 和 $mul$ 顾名思义是两个标记。这样,这个结点的值就被更新成了 $(val+add) \times mul$。(其实 $add$ 还要跟区间长度搞一搞,这里就省略了)。我们就知 阅读全文
posted @ 2018-02-25 13:30 poorpool 阅读(812) 评论(0) 推荐(1)
摘要: "hzwer的讲解" 一 给出一个长为 $n$ 的数列,以及 $n$ 个操作,操作涉及区间加法,单点查值。 cpp include include include include include using namespace std; int n, blc, a[50005], tag[50005 阅读全文
posted @ 2018-02-23 21:48 poorpool 阅读(457) 评论(0) 推荐(0)
摘要: 可以用树状数组,线段树,分块做。代码是分块 cpp include include include using namespace std; typedef long long ll; int n, m, uu, vv, ww, blc, bel[100005]; ll sum[100005], t 阅读全文
posted @ 2018-02-23 16:45 poorpool 阅读(94) 评论(0) 推荐(0)
摘要: 扫描线应该打懒标记的…… cpp include include include using namespace std; typedef long long ll; int T, n, m, w, h, cnt, uu, vv, ww, zdz[80005], ans, tag[80005]; l 阅读全文
posted @ 2018-02-23 15:18 poorpool 阅读(142) 评论(0) 推荐(0)
摘要: 题目: "poj1151" 建议先参考参考别的扫描线文档。 考虑这样一些矩形: 拿一根扫描线从左往右扫,扫描线被矩形覆盖的长度会变化当扫过矩形的左右边界时。 我们就剥离出来左右边界。我们把所有的 $y$ 值都保存下来离散化。 我们拿线段树维护扫描线。线段树结点应保存从第几个 $y$ 开始到第几个 $ 阅读全文
posted @ 2018-02-22 17:47 poorpool 阅读(217) 评论(0) 推荐(0)
摘要: 参见算法竞赛进阶指南190页 cpp include include include using namespace std; int n, m, num[10005], qwq=1, fa[10005], dis[10005]; char ss[15]; struct Node{ int l, r 阅读全文
posted @ 2018-02-21 21:09 poorpool 阅读(131) 评论(0) 推荐(0)
摘要: 参见算法竞赛进阶指南77页 参考算法竞赛进阶指南188页 cpp include include include using namespace std; int n, fa[10005], ans; struct Node{ int p, d; }nd[10005]; bool cmp(Node 阅读全文
posted @ 2018-02-20 16:47 poorpool 阅读(116) 评论(0) 推荐(0)
上一页 1 ··· 16 17 18 19 20 21 22 23 24 ··· 36 下一页