結果

問題 No.182 新規性の虜
ユーザー _k_a_n_i_
提出日時 2015-04-23 18:58:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 758 ms / 5,000 ms
コード長 1,026 bytes
コンパイル時間 3,249 ms
コンパイル使用メモリ 75,124 KB
実行使用メモリ 53,508 KB
最終ジャッジ日時 2024-12-26 19:06:29
合計ジャッジ時間 15,330 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main
{
    private final static Main main = new Main();

    public static void main(String[] args)
    {
        long l = System.currentTimeMillis();
        main.solve();
        //System.out.println("処理時間:" + (System.currentTimeMillis() - l));
    }

    private void solve()
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        for(int i=0; i<n; ++i)
        {
            int in = sc.nextInt();
            if(map.containsKey(in))
            {
                map.put(in, map.get(in)+1);
            }
            else
            {
                map.put(in, 1);
            }
        }
        int ans = 0;
        for(Map.Entry<Integer, Integer> e : map.entrySet())
        {
            if(e.getValue() == 1)
            {
                ++ans;
            }
        }
        System.out.println(ans);
    }
}
0