In the Kth root question?

in the Kth root question why r=1000000?

if n=10e15 and k=2
ans is 1000000 acc to the editorials code which is wrong

@mehulbhandari358 are you having doubt on sample case or editorial code?

in editorial code why is r=1000000. ?

@mehulbhandari358 because take n=1e15 , k=2 it will give 1e6 so its the highest possible ans for k>=2 thats why r is 1e6
(comment line 29 30 31 32 it will work fine then)

if k=2 that means

x^2<=1e15
x<=1e7
then how is 1e6 the maximum value

@mehulbhandari358 yes you are right take r as sqrt(n)

then is the editorials code wrong

@mehulbhandari358 yes conveying it to the problem setter will update the editorial
( will inform you when it will be updated)

@mehulbhandari358 editorial is corrected now r is replaced with 1e8

1 Like

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.