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 1263. Elections

WA #1 Please Help :( Alteast give me test case
Posted by alok13alok 4 Mar 2015 19:12
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Scanner;

public class Election {
    static long count;

    public static void main(String agrs[]) {
        Scanner scan = new Scanner(System.in);
        long N = scan.nextInt();
        long N1 = scan.nextInt();
        DecimalFormat form = new DecimalFormat("0.00");
        ArrayList<Integer> array = new ArrayList<Integer>();
        for (int i = 0; i < N1; i++) {
            array.add(scan.nextInt());
        }

        for (int i = 1; i <= N; i++) {

            for (int j = 0; j < N1; j++) {
                if (array.get(j) == i) {

                    count++;

                }

            }

            System.out.println(form.format((count * 100) / N1) + "%");
            count = 0;
        }
    }

}
===================
Cant find any error. :(