线段树合并
YZH__12345
这个作者很懒,什么都没留下…
展开
-
[bzoj3545][ONTAK2010]Peaks
线段树合并 Orz w_yqts 在dalao指导下AC了…Orz WA的原因可能是 在merge中如果a,b都是叶子会无法统计#include <bits/stdc++.h> using namespace std; #define N 2333333 inline int read() { char ch=getchar(); int x=0,f=1; while原创 2018-01-10 12:48:10 · 307 阅读 · 0 评论 -
[bzoj2733][HNOI2012]永无乡
Orz w_yqts 线段树合并裸题 每合并一次减少一个节点,所以复杂度可以接受#include <bits/stdc++.h> using namespace std; #define N 100005 struct node { int s,l,r; }tr[2333333]; int f[N],rt[N],a[N],id[N]; int n,trsz; inline int fin原创 2017-12-26 11:22:08 · 286 阅读 · 1 评论