Loading docs/ds/segment-tree-beats.md +7 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,10 @@ 这个算法的复杂度如何?使用势能分析法可以得到复杂度是 $O(m\log_2n)$ 的。具体分析过程见论文。 ```cpp ##include<cstdio>##include<algorithm>##include<cctype> using namespace std; #include<cstdio> #include<algorithm> #include<cctype> using namespace std; const int N = 1e6 + 6; char nc() { Loading Loading @@ -145,7 +148,9 @@ signed main() { 另外,BZOJ 这道题卡常……多数组线段树的常数比结构体线段树的常数大……在维护信息的时侯,当只有一两个数的时侯可能发生数集重合,比如一个数既是最大值又是次小值。这种要特判。 ```cpp ##include<cstdio>##include<iostream> using namespace std; #include<cstdio> #include<iostream> using namespace std; int inline rd() { register char act = 0; Loading Loading
docs/ds/segment-tree-beats.md +7 −2 Original line number Diff line number Diff line Loading @@ -23,7 +23,10 @@ 这个算法的复杂度如何?使用势能分析法可以得到复杂度是 $O(m\log_2n)$ 的。具体分析过程见论文。 ```cpp ##include<cstdio>##include<algorithm>##include<cctype> using namespace std; #include<cstdio> #include<algorithm> #include<cctype> using namespace std; const int N = 1e6 + 6; char nc() { Loading Loading @@ -145,7 +148,9 @@ signed main() { 另外,BZOJ 这道题卡常……多数组线段树的常数比结构体线段树的常数大……在维护信息的时侯,当只有一两个数的时侯可能发生数集重合,比如一个数既是最大值又是次小值。这种要特判。 ```cpp ##include<cstdio>##include<iostream> using namespace std; #include<cstdio> #include<iostream> using namespace std; int inline rd() { register char act = 0; Loading