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

Who working 1001 solution at the JAVA
Posted by Meni Packeou 7 Nov 2007 12:39
My code:
TimeLimitexed 9 tests:
help me if you know java



import java.io.*;
import java.util.*;

public class SumDif
{
   public static void main(String[] args) throws IOException
   {
      new SumDif().run();
   }
   int k=0;
   double[] a=new double[140000];;
   StreamTokenizer in;
   PrintWriter out;
   void oqi() throws IOException
   {
     while(in.nextToken()!=in.TT_EOF){
       a[k++]=(double)in.nval;
     }
     solve();
   }

   void run() throws  IOException
   {
      in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
      out = new PrintWriter(System.out);
      oqi();
      out.flush();
    }
   void solve() throws IOException
   {
    while(k>0)
     out.write(String.format("%.4f", Math.sqrt(a[--k]))+'\n');
   }
}