Why i am getting wa

Hello Apoorv, why are you doing this

        if(x==1)
        {
            updatelazy(lazy,tree,0,n-1,n-r-1,n-l-1,1,1);
        }
        else if(x==0)
        {
            updatelazy(lazy,tree,0,n-1,n-r-1,n-l-1,1,0);
        }
        else if(x==2)
        {
            long long int ans=querylazy(lazy,tree,0,n-1,n-r-1,n-l-1,1);
            long long int p=powmd(2,n-r-1);
            cout<<ans/p<<"\n";
        }

why are you passing n-l-1 and n-r-1 as a range. Pls explain your logic a little bit or you can also have a look at this.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.