Big Numbers Casuing Seg Fault in Query Bits question!

here’s my solution for query bits-

I’ve found that in my solution it sometimes requires finding the value of 2^200000 and other such big powers of 2.
And this is causing segfault in my program, Help me <3
The updateTree() method is running fine, the problem is with query() method.

For example, the following test case gives segfault-
200000 2
1 0 199999
2 0 199999

If you want to run and debug/check the code you can either use the link above or this - https://ide.codingblocks.com/s/197365