I’m unable to pass the test case wth 10^15 constraint.
Could someone help me, please. I know my funtion is returning 0, but how to calculate exponential value for long long int.
Link to my code: https://ide.codingblocks.com/s/204977
Thanks.
Query regarding the question
dont calculate using the power function. Since x would be small, Try to multiply it linearly.
bool flag=1;
long long tmp=1;
for(int i=1;i<=k;i++)
{
tmpc*= mid;
if(tmp>n)
{
flag=0;
break;
}
}
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.