void update(int x , int y , int val) { while (x <= max_x) { updatey(x , y , val);// this function should update array tree[x] x += (x & -x); } }
void updatex(int x,int y,int val){ while(x<=max_v){ updatey(x,y,val); x+=(x & -x); } }
inline void update(int x,int y) { while(x<=w) { updatey(x,y); x+=(x&-x); } }