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

why this java solution is wrong? (WA)
Posted by lpeter83 7 May 2011 19:27
                Locale.setDefault(Locale.US);
        ArrayList<Double> res = new ArrayList<Double>();
        while (hasNext()) {
            double a=nextDouble();
            res.add(Math.sqrt(a));
        }
        Collections.reverse(res);
        for (double a : res) {
            DecimalFormat df=new DecimalFormat("0.0000");
            System.out.println(df.format(a));
        }
                Judge status shows that this failed in test case 1.