摘要: #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=510000; const int Log=50; const int inf=2147483647; int val[N*Log],rnd[ 阅读全文
posted @ 2020-06-05 23:09 SegmentTree 阅读(32) 评论(0) 推荐(0) 编辑
摘要: #神仙的博客 #\(\tt notice:\) ##只有右插头和左插头可以合并,左插头和右插头只可以合并一次 #include<bits/stdc++.h> typedef long long ll; using namespace std; const int N=12; const int M= 阅读全文
posted @ 2020-06-05 23:07 SegmentTree 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 这是广义SAM #include<bits/stdc++.h> #define rep(x, L, R) for(int x = (L), _x = (R); x <= _x; x++) using namespace std; const int N = 2e6 + 10, md = 998244 阅读全文
posted @ 2020-06-05 23:05 SegmentTree 阅读(68) 评论(0) 推荐(0) 编辑
摘要: rk 排名,相同的排名相同 sa 排名的位置, 如果相同按位置顺序 y 辅助第二关键字 c 桶 理解 Q:为什么不可以将rk相同的按位置顺序变成不同的 A:这样如果第一关键字相同时比较第二关键字答案相反,就会有问题,如果这样对的,你的字典序在一开始就排好了 Q:y[sa[i]+k]不会越界吗? A: 阅读全文
posted @ 2020-06-05 23:03 SegmentTree 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 我觉得这种东西就是工程题,好像这就是Splay的唯一用途吧 神仙的博客 #include<bits/stdc++.h> #define lc(p) c[p][0] #define rc(p) c[p][1] using namespace std; const int N=310000; int f 阅读全文
posted @ 2020-06-05 16:12 SegmentTree 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 神仙的博客(还没看) #题目 ZJOI2005沼泽鳄鱼 ####就按照12为一个周期,然后转移的时候记得吧一些列删掉 #include<bits/stdc++.h> using namespace std; const int mod=10000; const int N=60; int n,m,S 阅读全文
posted @ 2020-06-04 15:33 SegmentTree 阅读(13) 评论(0) 推荐(0) 编辑
摘要: 一般用到只跟点数有关,多次查询的题目时就会用到虚树,同时还要支持快速查询点之间的信息 下面是消耗战的例子 神仙的博客 注意,这道题目的例子有点特殊,所以那位神仙的代码并不是一般题目通用的,但是我的代码是通用的 注意,1一定要加入点集中 #include<bits/stdc++.h> #define 阅读全文
posted @ 2020-05-28 16:39 SegmentTree 阅读(6) 评论(0) 推荐(0) 编辑