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
Posted by Peter 24 Feb 2012 12:23
import java.util.ArrayList;
import java.util.Scanner;

public class SqrtBack{


    public static void main(String[] args){

        Scanner in = new Scanner(System.in);
        ArrayList<Integer> list = new ArrayList<Integer>();
        for(int i=0; i<=args.length; i++){
            list.add(in.nextInt());
        }
        Integer ai[] = new Integer[list.size()];
        ai = list.toArray(ai);



        for(int j = ai.length-1; j >= 0; j--){

            System.out.printf("%.4f\r\n", Math.sqrt(ai[j]));

        }

    }
}
    i tested it its work fine, cant understand what is wrong
Re: java, wrong answer
Posted by Noob 25 Feb 2012 14:58
This is TIMUS! args variable is always empty
Re: java, wrong answer
Posted by Peter 27 Feb 2012 14:47
oh  :P