摘要:
#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[ 阅读全文
摘要:
#神仙的博客 #\(\tt notice:\) ##只有右插头和左插头可以合并,左插头和右插头只可以合并一次 #include<bits/stdc++.h> typedef long long ll; using namespace std; const int N=12; const int M= 阅读全文
摘要:
这是广义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 阅读全文
摘要:
rk 排名,相同的排名相同 sa 排名的位置, 如果相同按位置顺序 y 辅助第二关键字 c 桶 理解 Q:为什么不可以将rk相同的按位置顺序变成不同的 A:这样如果第一关键字相同时比较第二关键字答案相反,就会有问题,如果这样对的,你的字典序在一开始就排好了 Q:y[sa[i]+k]不会越界吗? A: 阅读全文
摘要:
我觉得这种东西就是工程题,好像这就是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 阅读全文