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 1001. Reverse Root

Time limit exceed in 7 test
Posted by Nitiraj Singh Rathore 13 Apr 2007 00:47
HI
this is my program. How should I improve on timing.

import java.util.Scanner;
 /* @author nitiraj
 */
import java.util.* ;
import java.io.* ;

public class Q1001
{

    /** Creates a new instance of Q2 */
    public Q1001()
    {
    }

    public static void main( String args[] ) throws IOException
    {
        BufferedReader bi = new BufferedReader( new InputStreamReader( System.in ) ) ;
        String input ;
        String str = "" ;
        StringTokenizer st ;
        while( ( input = bi.readLine() )!= null )
         {
             st = new StringTokenizer( input ) ;
             while( st.hasMoreTokens() )
             {
                 String temp = st.nextToken() ;
                 str = temp.concat( "\n" ).concat( str ) ;
             }
         }

         st = new StringTokenizer( str ) ;
         double d ;

          while( st.hasMoreTokens() )
          {
              d = Double.parseDouble( st.nextToken() ) ;
              System.out.printf( "%.6f\n" , Math.sqrt(d ) ) ;
          }

      }
}

CAN WE GET THE TEST CASES WHICH THEY USE FOR THERE TESTING

Please tell

thanks
Bye
Nitiraj