|
|
back to boardHow to reduce time?? Soln accepted but time is .156 how to reduce to atleast 0.078 and also how to reduce memory usuage? import java.util.*; import java.io.*; public class prob1264{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); PrintWriter out=new PrintWriter(System.out); int n=sc.nextInt(); int m=sc.nextInt(); int result=n*(m+1); out.print(result); out.close(); } } Re: How to reduce time?? Posted by jcoder 3 Nov 2008 13:00 Just use such construction, I have time 0.093: StreamTokenizer in = new StreamTokenizer(new BufferedReader( new InputStreamReader(System.in))); PrintWriter out = new PrintWriter( new OutputStreamWriter(System.out), true);
in.nextToken(); int n = (int)in.nval; in.nextToken(); int m = (int)in.nval;
out.println(n * (m + 1)); Re: How to reduce time?? I know the problem! You're using Java. Re: How to reduce time?? Posted by alvaro 12 Aug 2013 22:03 hahahaha Re: How to reduce time?? ahahahaha Re: How to reduce time?? Posted by ALZO 11 Jan 2022 10:41 hahahahahhahahahahhha |
|
|