Segment Tree with lazzy
#include<iostream> using namespace std; int tree[300005]; class Node{ public: int data; int lazzy; Node* parent,*left,*right; int leftLimit,rightLimit; }; void buildSeg(Node* root,int st,int en){ cout<<"("<<st<<", "<<en<<")"<<endl; root->leftLimit=st; root->rightLimit=en; if(st==en){ root->data=0; root->lazzy=0; //cout<<"Data seted to :"<<root->data<<endl; //return root->data; return; } int mid=(st+en)/2; Node* leftC,*rightC; ...