Kth root - wrong answer

It is failing some test cases. Please help out.

#include
#include <math.h>
#define ll long long unsigned
using namespace std;

ll power(ll x, ll k)
{
if(k==0){
return 1;
}
ll ans = 1;
while(k–)
{
ans = x*ans;
}
return ans;
}

bool isAns(ll n, ll k, ll mid)
{
if(power(n,k) <= mid)
{
return true;
}
else{
return false;
}
}

int main() {

int t;
cin>>t;

//cout<<power(10,10)<<endl;

while(t--)
{
	ll n,k;
	cin>>n>>k;

	ll s=0;
	ll e=n;

	ll ans = 1;

	while(s<=e)
    {
        //cout<<"S: "<<s<<" E: "<<e<<endl;
        ll mid = (s+e)/2;
        //cout<<"Mid: "<<mid<<endl;
        if(isAns(mid,k,n))
        {
            ans = mid;
            //cout<<"Ans: "<<ans<<endl;
            s = mid+1;
        }
        else{
            e = mid-1;
        }
	}

	cout<<ans<<endl;
}

return 0;

}

@abhishekchoudhary Please save your code on https://ide.codingblocks.com/ and share the link

@You were getting wrong answer because of overflow issue .
So I adjusted that . Please see the changes in the power function https://ide.codingblocks.com/s/190195

@abhishekchoudhary If you don’t have any further queries please mark the doubt as resolved.