Sir what is wrong in this code

#include
#include<math.h>
#include
using namespace std;
bool check(long int n,long int k,long int mid)
{
if(pow(mid,k)>=n)
{
return true;
}
else
{
return false;
}
}
int find_no(long int n,long int k)
{
long int s=0;
long int e=n;
long int ans=-1;
while(s<=e)
{
long int mid=(s+e)/2;
if(check(n,k,mid))
{
ans=mid;
e=mid-1;
}
else
{
s=mid+1;
}
}
}
int main() {
int t;
cin>>t;
while(t>0)
{
long long int n,k;
cin>>n>>k;
cout<<find_no(n,k)<<endl;
t–;
}
return 0;
}

Hi @Harshit-Kumar-2577121455897279
Here is d updated code.


if u still find any problem, feel free to post ur doubt here.

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.