Https://ide.codingblocks.com/s/124747

showing input mismatch error. plz help

  long n=scn.nextLong();

You need to write this instead of nextInt(). Using long won’t be enough here, you will need to use double otherwise you won’t get correct answer

for input 1000000000000000 10 output is showing as 1. plz resolve

why i need to use double?

stiil only one test case is passing

You need to use Double because of the input constraints. According to the question, you need to find the greatest integer x, such that, x^k <= n. So your logic will work correctly for x^k = n but will not give correct answer for x^k<n. You will need to apply binary search in this problem. For every possible mid obtained by using binary search, check if it is the best suitable candidate or not for becoming the Kth root and then we reduce the search space of the binary search according to the mid value. If mid^k is greater than N then we will find the best suitable value from left to mid-1 otherwise we will find much larger value by finding it from mid+1 to right.

unable to understand

please reply.unable to solve this problem

in order to find greatest ‘x’ for which x^k<=n, you will have to try finding the answer by keeping every possible value for x from 1 to max possible value of (calculate from constraints). But doing this would not be very efficient, so you would need to use binary search with low =1 and high = max possible x. Whichever largest value for x satisfies the above equation would be your answer