結果

問題 No.182 新規性の虜
ユーザー yomo3yomo3
提出日時 2020-05-07 22:25:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 681 ms / 5,000 ms
コード長 447 bytes
コンパイル時間 2,405 ms
コンパイル使用メモリ 80,200 KB
実行使用メモリ 65,044 KB
最終ジャッジ日時 2023-09-16 08:10:17
合計ジャッジ時間 14,280 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
56,104 KB
testcase_01 AC 125 ms
56,088 KB
testcase_02 AC 132 ms
55,928 KB
testcase_03 AC 130 ms
55,944 KB
testcase_04 AC 127 ms
56,132 KB
testcase_05 AC 130 ms
56,104 KB
testcase_06 AC 127 ms
56,040 KB
testcase_07 AC 130 ms
55,908 KB
testcase_08 AC 528 ms
63,432 KB
testcase_09 AC 681 ms
65,044 KB
testcase_10 AC 635 ms
64,928 KB
testcase_11 AC 624 ms
63,164 KB
testcase_12 AC 433 ms
60,616 KB
testcase_13 AC 130 ms
54,584 KB
testcase_14 AC 135 ms
56,048 KB
testcase_15 AC 129 ms
56,076 KB
testcase_16 AC 132 ms
55,812 KB
testcase_17 AC 140 ms
56,052 KB
testcase_18 AC 539 ms
60,332 KB
testcase_19 AC 454 ms
60,756 KB
testcase_20 AC 392 ms
60,964 KB
testcase_21 AC 526 ms
60,560 KB
testcase_22 AC 402 ms
60,472 KB
testcase_23 AC 125 ms
56,004 KB
testcase_24 AC 580 ms
64,932 KB
testcase_25 AC 480 ms
60,328 KB
testcase_26 AC 306 ms
60,356 KB
testcase_27 AC 126 ms
55,740 KB
evil01.txt AC 677 ms
66,628 KB
evil02.txt AC 708 ms
66,780 KB
権限があれば一括ダウンロードができます

ソースコード

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