ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1264. Workdays

How to reduce time??
Posted by Varun Kumar(Fundu) 15 Sep 2008 21:39
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??
Posted by RainbowDash 26 Nov 2012 21:33
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??
Posted by Ivan Metelev UFU SESC 29 Oct 2014 20:01
ahahahaha
Re: How to reduce time??
Posted by ALZO 11 Jan 2022 10:41
hahahahahhahahahahhha