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

Java WA on test 1
Posted by Izobara 2 Oct 2013 14:41
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        List<Double> a = new ArrayList<Double>();
        while (in.hasNextDouble() ) {
            a.add(in.nextDouble());
        }

        DecimalFormat df = new DecimalFormat("#.0000");
        for (int i = a.size() - 1; i >= 0; --i) {
            out.println(df.format(Math.sqrt(a.get(i))));
        }
    }
}


And I realy don't understand where is my problem



Edited by author 02.10.2013 14:42
Re: Java WA on test 1
Posted by Eric 8 Oct 2013 14:53
Change List<Double> to List<Long>