Kth root test cases failing for very large integers


This is my code. I am unable to find the error

I have edited your code… try to submit it now…

https://ide.codingblocks.com/s/210677 Why this doesn’t work? I made a variable and stores pow(mid,p) in it and then compared it but it shows wrong answer but in the other case as you did without storing the variable you directly checked it and gives correct answer. Why is that so?

I think in that case… Your answer is not getting updated in the case where u have used a separate variable to store… Rest the logic is same in both cases…