結果

問題 No.182 新規性の虜
ユーザー yomo3
提出日時 2020-05-07 22:27:58
言語 Java
(openjdk 23)
結果
AC  
実行時間 689 ms / 5,000 ms
コード長 499 bytes
コンパイル時間 3,003 ms
コンパイル使用メモリ 94,208 KB
実行使用メモリ 64,356 KB
最終ジャッジ日時 2024-07-03 09:37:42
合計ジャッジ時間 14,746 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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();
        Map<Integer, Integer> m = new HashMap<>();
        for (int i = 0; i < N; i++) {
            int A = Integer.parseInt(sc.next());
            // int A = sc.nextInt();
            m.merge(A, 1, Integer::sum);
        }
        long ans = m.values().stream().filter(e -> e == 1).count();
        System.out.println(ans);
    }    
}
0