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 1718. Rejudge

Crash #3
Posted by Muzaffar [Al-Khorazmiy 5] 2 Nov 2009 16:44
Why is this code crashing on test #3?!
Please give me test 3. My e-mail: muzaffar-17@bk.ru


import java.util.HashSet;
import java.util.Locale;
import java.util.Scanner;
import java.util.Set;

public class m1718 {
    public static void main(String[] args)  {
        Locale.setDefault(Locale.US);
        Scanner sc=new Scanner(System.in);
        int n=Integer.parseInt(sc.nextLine());
        Set<String> set=new HashSet<String>();
        String[][] nick=new String[n][10];
        int[] d=new int[n];
        for (int i = 0; i <n; i++) {
            nick[i]=sc.nextLine().split(" ");
            if(nick[i][1].equals("AC")) d[i]=0;
            else d[i]=Integer.parseInt(nick[i][2]);
        }int min=0;
        for (int i = 0; i <n; i++) {
            if(d[i]==0)set.add(nick[i][0]);
            if(d[i]>=6)set.add(nick[i][0]);
            if(d[i]==7)min++;
        }
        System.out.println(min+" "+set.size());
    }

}