sir have a look plz ,is there any method faster than it…
i m getting TLE in one of my test case…
import java.util.Scanner;
public class Main {
static Scanner s=new Scanner(System.in);
public static void main(String[] args) {
// TODO Auto-generated method stub
int n=s.nextInt();
double[] ans=new double[n];
int[] pow=new int[n];
for(int i=0;i<n ;i++) {
ans[i] =s.nextDouble();
pow[i] =s.nextInt();
}
for(int j=0;j<n;j++) {
int fin=0;
double res=0;
for(int i=1;res <=ans[j] && i<=ans[j]; i++) {
res=Math.pow(i,pow[j]);
if(res <=ans[j]) {
fin=i;
}
}
System.out.println(fin);
}
}
}