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 1496. Spammer

Why Crash?
Posted by coalminer 12 Sep 2011 18:14
Hello!
This is listing of my class

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;


public class q1496 {

    /**
     * @param args
     * @throws IOException
     * @throws NumberFormatException
     */
    public static void main(String[] args) throws NumberFormatException, IOException
    {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        int amount = Integer.parseInt(in.readLine());
        String[] source= new String[amount];
        String[] uniT= new String[amount];
        int j=0;
        int count=0;
        for (int i=0;i<amount;i++)
           {
            source[i]=in.readLine();
           }
        Arrays.sort(source);
        uniT[0]=source[0];

        for (int i=0;i<amount;i++)
           {
            if (source[i].equals(uniT[j])!=true)
               {
                j++;
                uniT[j]=source[i];
               }
           }
        for (int i=0;i<=j;i++)
            {
            count=0;
             for (int k=0;k<amount;k++)
                 {
                 if (source[k].equals(uniT[i]))
                     {
                     count++;
                     }
                   }
             if (count>1){System.out.println(uniT[i]);}
            }
    }

}