結果

問題 No.182 新規性の虜
ユーザー yomo3yomo3
提出日時 2020-05-07 22:27:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 633 ms / 5,000 ms
コード長 499 bytes
コンパイル時間 4,983 ms
コンパイル使用メモリ 84,600 KB
実行使用メモリ 66,312 KB
最終ジャッジ日時 2023-09-16 08:08:39
合計ジャッジ時間 16,254 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
56,080 KB
testcase_01 AC 128 ms
56,012 KB
testcase_02 AC 127 ms
55,836 KB
testcase_03 AC 130 ms
55,676 KB
testcase_04 AC 129 ms
56,268 KB
testcase_05 AC 131 ms
56,296 KB
testcase_06 AC 133 ms
56,020 KB
testcase_07 AC 130 ms
55,920 KB
testcase_08 AC 502 ms
63,868 KB
testcase_09 AC 633 ms
66,312 KB
testcase_10 AC 591 ms
66,020 KB
testcase_11 AC 526 ms
63,476 KB
testcase_12 AC 340 ms
60,948 KB
testcase_13 AC 132 ms
56,336 KB
testcase_14 AC 135 ms
55,804 KB
testcase_15 AC 132 ms
55,812 KB
testcase_16 AC 133 ms
56,032 KB
testcase_17 AC 134 ms
55,948 KB
testcase_18 AC 423 ms
60,692 KB
testcase_19 AC 371 ms
60,592 KB
testcase_20 AC 306 ms
60,288 KB
testcase_21 AC 445 ms
60,900 KB
testcase_22 AC 334 ms
60,332 KB
testcase_23 AC 130 ms
55,796 KB
testcase_24 AC 481 ms
65,580 KB
testcase_25 AC 390 ms
60,652 KB
testcase_26 AC 252 ms
60,132 KB
testcase_27 AC 128 ms
56,096 KB
evil01.txt AC 558 ms
65,756 KB
evil02.txt AC 553 ms
65,912 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 = 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