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] Wrong answer test 3 - what is going on ?
Posted by Zawi 21 Jul 2012 20:09
I do not understand what is wrong with my code it works ok on my PC:

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in, "ISO-8859-1"));
        char[] buffer = new char[262144];
        br.read(buffer);
        Scanner in = new Scanner(new String(buffer));
        Stack<String> lifo = new Stack<String>();
        DecimalFormat format = new DecimalFormat("0.00000", new DecimalFormatSymbols(Locale.US));
        while (in.hasNextLong()) {
            lifo.push(format.format(Math.sqrt(in.nextLong())));
        }
        while(!lifo.empty()){
            System.out.println(lifo.pop());
        }
    }

Could someone explain it to me ?
Re: [java] Wrong answer test 3 - what is going on ?
Posted by RainbowDash 30 Sep 2012 19:33


Edited by author 30.09.2012 19:33