/* mbinary ######################################################################### # File : segTree.cc # Author: mbinary # Mail: zhuheqin1@gmail.com # Blog: https://mbinary.coding.me # Github: https://github.com/mbinary # Created Time: 2018-05-19 23:06 # Description: ######################################################################### */ #include template bool operator <(type x,type y){return x class segTree { int size; type *p; public: segTree(int n=1); ~segTree(); void update(int i,type x); type getMin(int a,int b){return find(a,b,1,size,1);} type find(int a,int b,int i,int j,int); }; template segTree::segTree(int n):size(1) { while(size segTree::~segTree(){delete p;} template void segTree::update(int i,type x) { i+=size-1; p[i]=x; while(i!=0){ i/=2; p[i]=p[i*2] type segTree::find(int a,int b,int i , int j,int k) { if(br ?l:r; }