結果

問題 No.182 新規性の虜
ユーザー tenten
提出日時 2020-10-09 13:08:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 745 ms / 5,000 ms
コード長 625 bytes
コンパイル時間 2,267 ms
コンパイル使用メモリ 84,452 KB
実行使用メモリ 62,820 KB
最終ジャッジ日時 2024-07-20 06:45:04
合計ジャッジ時間 15,174 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (map.containsKey(x)) {
                map.put(x, map.get(x) + 1);
            } else {
                map.put(x, 1);
            }
        }
        int count = 0;
        for (int x : map.values()) {
            if (x == 1) {
                count++;
            }
        }
        System.out.println(count);
    }
}
0