随笔分类 -  数据结构 树

摘要:动态开点权值线段树 均摊复杂度分析 阅读全文
posted @ 2021-10-05 20:27 GhostCai 阅读(75) 评论(0) 推荐(0) 编辑
摘要:dfs,思路 阅读全文
posted @ 2020-08-23 15:48 GhostCai 阅读(133) 评论(0) 推荐(0) 编辑
摘要:主席树 阅读全文
posted @ 2020-08-15 23:26 GhostCai 阅读(146) 评论(0) 推荐(0) 编辑
摘要:贪心,线段树 阅读全文
posted @ 2020-08-15 22:51 GhostCai 阅读(217) 评论(0) 推荐(0) 编辑
摘要:二分答案,线段树 阅读全文
posted @ 2018-11-02 22:28 GhostCai 阅读(173) 评论(0) 推荐(1) 编辑
摘要:基环树直径,单调队列优化DP 阅读全文
posted @ 2018-10-31 15:15 GhostCai 阅读(261) 评论(0) 推荐(0) 编辑
摘要:树上差分,二分答案 阅读全文
posted @ 2018-10-13 08:45 GhostCai 阅读(92) 评论(0) 推荐(0) 编辑
摘要:Kruskal重构树 阅读全文
posted @ 2018-10-02 21:44 GhostCai 阅读(91) 评论(0) 推荐(0) 编辑
摘要:树上差分;权值线段树合并 阅读全文
posted @ 2018-09-13 17:08 GhostCai 阅读(159) 评论(0) 推荐(0) 编辑
摘要:树状数组,离线处理 阅读全文
posted @ 2018-07-27 16:01 GhostCai 阅读(101) 评论(0) 推荐(0) 编辑
摘要:见7.3测试 阅读全文
posted @ 2018-07-03 21:03 GhostCai 阅读(123) 评论(0) 推荐(0) 编辑
摘要:POJ2001 求一群字符串的最短能代表该串的前缀,trie裸题#include#include#includeusing namespace std;const int MAXN=1024;const int C_SIZE=32;const int MAXNNODE... 阅读全文
posted @ 2018-06-25 11:00 GhostCai 阅读(74) 评论(0) 推荐(0) 编辑
摘要:安装操作就是链上统计+更改,卸载操作就是子树统计+更改,没有比树剖更合适的了。 数组开小会莫名WA..qwq#include#includeusing namespace std;const int MAXN=1000005;int n,m;#define ls (c... 阅读全文
posted @ 2018-06-24 11:57 GhostCai 阅读(114) 评论(0) 推荐(0) 编辑
摘要:Black Box是一种原始的数据库。它可以储存一个整数数组,还有一个特别的变量i。最开始的时候Black Box是空的.而i等于0。这个Black Box要处理一串命令。命令只有两种:ADD(x):把x元素放进BlackBox;GET:i加1,然后输出Blackho... 阅读全文
posted @ 2018-06-15 08:13 GhostCai 阅读(92) 评论(0) 推荐(0) 编辑
摘要:由于中序遍历不会因为旋转改变,平衡树可以作为区间树使用。 翻转用打标记的方法,splay(x,y)代表把x接到以y为根的子树下面。#include#includeusing namespace std;const int MAXN=100005;int n,m;int... 阅读全文
posted @ 2018-06-14 08:51 GhostCai 阅读(109) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 5 Sec Memory Limit: 162 MBSubmit: 18888 Solved: 7955[Submit][Status][Discuss]Description营业额统计 Tiger最近被公司升任为营业部经理,他上任后接受公... 阅读全文
posted @ 2018-06-13 21:45 GhostCai 阅读(82) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 3 Sec Memory Limit: 162 MBSubmit: 13224 Solved: 5728[Submit][Status][Discuss]Description 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作... 阅读全文
posted @ 2018-06-12 08:39 GhostCai 阅读(106) 评论(0) 推荐(0) 编辑
摘要:欠了好久的Splay,以后就它了。 默写真不容易,过几天估计就忘了.. 整个Splay真的精妙,不拖泥带水那种.. 前驱后继之所以不能用rk转到根,是因为这个数不一定存在。。 kth中#include#define check(x) (x==ch[fa[x]][1])... 阅读全文
posted @ 2018-06-11 20:13 GhostCai 阅读(117) 评论(0) 推荐(0) 编辑
摘要:Time Limit: 20 Sec Memory Limit: 256 MBSubmit: 495 Solved: 344[Submit][Status][Discuss]Description小R和B神正在玩一款游戏。这款游戏的地图由N个点和N-1条无向边组成... 阅读全文
posted @ 2018-06-05 15:40 GhostCai 阅读(118) 评论(0) 推荐(0) 编辑
摘要:题目描述几乎整个Byteland王国都被森林和河流所覆盖。小点的河汇聚到一起,形成了稍大点的河。就这样,所有的河水都汇聚并流进了一条大河,最后这条大河流进了大海。这条大河的入海口处有一个村庄——名叫Bytetown。在Byteland国,有n个伐木的村庄,这些村庄都座... 阅读全文
posted @ 2018-06-05 14:38 GhostCai 阅读(125) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示