摘要: treap求中位数。 cpp include include include using namespace std; typedef long long ll; int n, m, rot, siz, uu, vv; ll h[1005], all, num, tmp, ans[1005][100 阅读全文
posted @ 2017-12-04 21:40 poorpool 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 并查集+treap维护的第k 大 数 cpp include include include using namespace std; struct Node{ int val, l, r, rnd, sze, hav; }nd[200005]; int n, m, fa[200005], hmn[ 阅读全文
posted @ 2017-12-04 20:15 poorpool 阅读(218) 评论(0) 推荐(0) 编辑
摘要: treap做法,参考 "hzwer的博客" splay做法,参照 "zyf2000" ,但是一般我们用splay都是维护区间的 阅读全文
posted @ 2017-12-04 18:52 poorpool 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 模板题 cpp include include using namespace std; struct Edge{ int too, nxt; }edge[200005]; int n, m, dfn[100005], loo[100005], ind, uu, vv, cnt, hea[10000 阅读全文
posted @ 2017-12-04 10:51 poorpool 阅读(185) 评论(0) 推荐(0) 编辑