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

Runtime Error. Why?
Posted by Derrick Ong 31 Jan 2015 06:04
import java.util.*;
import java.io.*;

public class root
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner(System.in);

        ArrayList<Long> list = new ArrayList<Long>();

        while (in.hasNextLine())
        {
                list.add(in.nextLong());
        }

        Collections.reverse(list);

        for (long x : list)
        {
            System.out.printf("%.4f", Math.sqrt(x));
            System.out.println();
        }
    }

}

Works on my computer with the given input.

Edited by author 31.01.2015 06:20