結果

問題 No.182 新規性の虜
ユーザー yomo3
提出日時 2020-05-07 22:25:47
言語 Java
(openjdk 23)
結果
AC  
実行時間 759 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 2,401 ms
コンパイル使用メモリ 80,156 KB
実行使用メモリ 64,972 KB
最終ジャッジ日時 2024-07-03 09:39:40
合計ジャッジ時間 14,681 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 = sc.nextInt();
            m.merge(A, 1, Integer::sum);
        }
        long ans = m.values().stream().filter(e -> e == 1).count();
        System.out.println(ans);
    }    
}
0