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

Kirill WA in JAVA - Why? [3] // Problem 1001. Reverse Root 22 Jan 2016 13:26
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.*;

public class Try2 {

    public static void main(String[] args)
    {
        DecimalFormatSymbols s = new DecimalFormatSymbols();
        s.setDecimalSeparator('.');
        DecimalFormat f = new DecimalFormat("#,####0.0000",s);
        Scanner in = new Scanner(System.in);
        while (in.hasNextLong())
        {
        System.out.println(f.format(Math.sqrt(in.nextLong()) ));
        }
    }
}
ToadMonster Re: WA in JAVA - Why? [2] // Problem 1001. Reverse Root 22 Jan 2016 14:32
Task:
> For each number Ai from the last one till the first one ...

So, did you try to check your solution on sample? Did you notice that numbers in your answer are in the wrong order?
Kirill Re: WA in JAVA - Why? [1] // Problem 1001. Reverse Root 22 Jan 2016 14:44
oh, thanks!
JavaClass Re: WA in JAVA - Why? // Problem 1001. Reverse Root 17 Feb 2016 00:19
So, did You solve this problem with sqrt in wrong order? If
You did, explain how?