code: #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
while(t–)
{
int n,k;
cin>>n>>k;
int x=0;
if(pow(x,k)<=n)
{
x++;
cout<<x;
}
}
return 0;
}
code: #include<bits/stdc++.h>
using namespace std;
int main() {
int t;
while(t–)
{
int n,k;
cin>>n>>k;
int x=0;
if(pow(x,k)<=n)
{
x++;
cout<<x;
}
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t–)
{
int n,k;
cin>>n>>k;
int x=0;
while(pow(x,k)<=n)
{
x++;
// cout<<x;
}
cout<<x<<endl;
}
return 0;
}
this is the correct code but it is giving tle as the test cases are larger.
it is not optimised.