####kquery0 error

##error

@nmaurya760,
Why have you declared vector<int>tree[n * 4]; inside build and query functions. Segment tree should be global so that it can be accessed by any function.

still errors are comming

@nmaurya760,
Please share Coding Blocks IDE link of your code.
Also global arrays should have static size, so try something like vector<int>tree[400005];

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.