how to store the 10^15 range values?
How to handle this large contraints
to store large values upto 10^18 you can use long long int
in this question actually no need to calculate x^mid exactly
because this will definitely overflow
look at modified code
Modified Code
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like
: and don’t forgot to mark doubt as resolved 
@asaurabh_26 can u please tell me what are the limitation of int , long int and other like ling long int , it store more value or somethings related to bits.
and where is the overflow in my code and what’s int_32 in main
we define int as long long int
but main() should return int not long long int
so i can return type int32_t (32bit integer)
bits.
and where is the overflow
int can store till 10^9
long long int 10^18
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.