摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 struct trie 6 { 7 int count; 8 trie *next[26],*fail; 9 }*q[5000000]; 10 int head,tail; 11 char keyword[55]; 12 c... 阅读全文
posted @ 2019-06-13 20:08 Al_Ca 阅读(113) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 #include 3 #include 4 #define INF 0x7fffffff 5 using namespace std ; 6 struct treap 7 { 8 int l,r,val,dat,cnt,size; 9 #define l(x) tr[x].l 10 #define r(x) ... 阅读全文
posted @ 2019-06-13 17:43 Al_Ca 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 真的是个神题,蒟蒻表示无力吐槽。刚开始以为是一个板子题,看着题解打了一遍,大概也理解了他是怎么实现的,然后我就去做别的题了,然后就在Three_D大佬的询问下蒙*了。最后还是问的nc哥,并思考了一个中午才搞明白。最主要的一点是,旋转不会改变树的中序遍历。 【建树操作】 对于一棵BST,区间[l,r] 阅读全文
posted @ 2019-06-13 17:21 Al_Ca 阅读(270) 评论(0) 推荐(2) 编辑
摘要: 1 #include 2 #include 3 #define cin(x) scanf("%d",&x) 4 using namespace std; 5 int ch[10000010][2],key[10000010], 6 cnt[10000010],size[10000010],sz,rt,f[10000010]; 7 bool get(int x... 阅读全文
posted @ 2019-06-13 17:15 Al_Ca 阅读(116) 评论(0) 推荐(0) 编辑
ヾ(≧O≦)〃嗷~