Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

A SINGLE LINE LOGIC ALSO GIVING TLE FOR DCE05 question !!!!

$
0
0

the question link is

http://www.codechef.com/problems/DCE05
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!!!


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>