結果

問題 No.182 新規性の虜
ユーザー samplelpmassamplelpmas
提出日時 2016-11-16 02:09:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 704 ms / 5,000 ms
コード長 704 bytes
コンパイル時間 4,349 ms
コンパイル使用メモリ 73,516 KB
実行使用メモリ 66,820 KB
最終ジャッジ日時 2023-08-27 13:51:46
合計ジャッジ時間 15,205 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,984 KB
testcase_01 AC 127 ms
55,892 KB
testcase_02 AC 127 ms
56,044 KB
testcase_03 AC 129 ms
55,828 KB
testcase_04 AC 129 ms
56,112 KB
testcase_05 AC 133 ms
55,896 KB
testcase_06 AC 128 ms
55,848 KB
testcase_07 AC 131 ms
56,048 KB
testcase_08 AC 540 ms
62,984 KB
testcase_09 AC 704 ms
64,712 KB
testcase_10 AC 645 ms
64,640 KB
testcase_11 AC 630 ms
62,912 KB
testcase_12 AC 430 ms
61,012 KB
testcase_13 AC 128 ms
55,884 KB
testcase_14 AC 133 ms
56,124 KB
testcase_15 AC 127 ms
56,196 KB
testcase_16 AC 130 ms
55,780 KB
testcase_17 AC 133 ms
56,032 KB
testcase_18 AC 545 ms
60,204 KB
testcase_19 AC 449 ms
60,276 KB
testcase_20 AC 403 ms
60,128 KB
testcase_21 AC 553 ms
60,496 KB
testcase_22 AC 422 ms
60,380 KB
testcase_23 AC 130 ms
56,060 KB
testcase_24 AC 612 ms
66,820 KB
testcase_25 AC 515 ms
60,580 KB
testcase_26 AC 307 ms
60,548 KB
testcase_27 AC 127 ms
55,604 KB
evil01.txt AC 697 ms
68,356 KB
evil02.txt AC 695 ms
67,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashMap;
import java.util.Scanner;

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<Integer, Integer>();

        for (int i = 0; i < n; i++) {

            int a = sc.nextInt();

            if (map.containsKey(a)) {
                map.put(a, (map.get(a) + 1));
            } else {
                map.put(a, 1);
            }

        }

        int count = 0;

        for (int key : map.keySet()) {

            if (map.get(key) == 1) {
                count++;
            }

        }

        System.out.println(count);

    }

}
0