the question link is
DCE05 Problem - CodeChef
my solution is below…!!!
package mat;
import java.lang.Math;
import java.util.Scanner;
public class Mat {
public static void main(String[] args) {
// TODO code application logic here
Scanner sc;
sc = new Scanner(System.in);
double i,j,k,n;
long ans,t;
t=sc.nextLong();
while(t-->0)
{
n=sc.nextLong();
ans=(long)Math.pow(2,Math.getExponent(n));
System.out.println(ans);
}
}
}
the above code results TLE… can anyone plzzzz help me!!!