結果

問題 No.182 新規性の虜
ユーザー yomo3yomo3
提出日時 2020-05-07 23:48:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 296 ms / 5,000 ms
コード長 645 bytes
コンパイル時間 2,522 ms
コンパイル使用メモリ 78,276 KB
実行使用メモリ 68,000 KB
最終ジャッジ日時 2023-09-16 08:13:32
合計ジャッジ時間 7,918 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
51,044 KB
testcase_01 AC 56 ms
50,912 KB
testcase_02 AC 56 ms
50,992 KB
testcase_03 AC 57 ms
51,024 KB
testcase_04 AC 56 ms
51,036 KB
testcase_05 AC 56 ms
50,984 KB
testcase_06 AC 57 ms
51,072 KB
testcase_07 AC 56 ms
49,040 KB
testcase_08 AC 225 ms
61,264 KB
testcase_09 AC 296 ms
64,824 KB
testcase_10 AC 287 ms
64,312 KB
testcase_11 AC 256 ms
61,580 KB
testcase_12 AC 177 ms
60,136 KB
testcase_13 AC 57 ms
50,956 KB
testcase_14 AC 56 ms
50,392 KB
testcase_15 AC 56 ms
51,212 KB
testcase_16 AC 57 ms
49,444 KB
testcase_17 AC 57 ms
50,968 KB
testcase_18 AC 201 ms
61,200 KB
testcase_19 AC 190 ms
58,740 KB
testcase_20 AC 159 ms
57,024 KB
testcase_21 AC 215 ms
61,192 KB
testcase_22 AC 164 ms
58,572 KB
testcase_23 AC 56 ms
51,252 KB
testcase_24 AC 290 ms
68,000 KB
testcase_25 AC 206 ms
61,952 KB
testcase_26 AC 131 ms
55,620 KB
testcase_27 AC 56 ms
51,248 KB
evil01.txt AC 317 ms
67,120 KB
evil02.txt AC 319 ms
67,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.InputStreamReader;
import java.io.BufferedReader;


public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(br.readLine());
        String[] sa = br.readLine().split(" ");
        Map<Integer, Integer> m = new HashMap<>();
        for (int i = 0; i < N; i++) {
            int A = Integer.parseInt(sa[i]);
            m.merge(A, 1, Integer::sum);
        }
        long ans = m.values().stream().filter(e -> e == 1).count();
        System.out.println(ans);
    }    
}
0