my solution is giving SIGSEGV in multq3.. plz help

i have used segmented tree but still its giving sigsegv

here is the link to my solution. Plz help.

Thank you in advance.

declare your array globally , because globally declared arrays are allocated on heap , whereas arrays declared inside function are declared on stack memory .
perhaps the memory you are trying to allocate in not available due to lack of stack memory .

1 Like

already did that… still sigsegv :-/

Then Try allocating memory using malloc

did that using new and delete in c++ :-/

the problem is with your segment tree functions , for debugging i gave about 10 submissions with SIGSEGV