結果

問題 No.182 新規性の虜
ユーザー jimanojimano
提出日時 2018-01-15 23:34:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 673 ms / 5,000 ms
コード長 524 bytes
コンパイル時間 3,671 ms
コンパイル使用メモリ 83,136 KB
実行使用メモリ 66,776 KB
最終ジャッジ日時 2023-08-27 17:06:11
合計ジャッジ時間 15,929 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
56,224 KB
testcase_01 AC 127 ms
56,392 KB
testcase_02 AC 127 ms
55,880 KB
testcase_03 AC 128 ms
55,808 KB
testcase_04 AC 126 ms
55,892 KB
testcase_05 AC 128 ms
55,716 KB
testcase_06 AC 127 ms
55,928 KB
testcase_07 AC 128 ms
55,928 KB
testcase_08 AC 530 ms
63,164 KB
testcase_09 AC 673 ms
66,148 KB
testcase_10 AC 617 ms
63,460 KB
testcase_11 AC 609 ms
62,652 KB
testcase_12 AC 424 ms
60,820 KB
testcase_13 AC 130 ms
55,724 KB
testcase_14 AC 133 ms
56,032 KB
testcase_15 AC 127 ms
56,268 KB
testcase_16 AC 125 ms
56,216 KB
testcase_17 AC 131 ms
55,884 KB
testcase_18 AC 543 ms
60,548 KB
testcase_19 AC 467 ms
60,436 KB
testcase_20 AC 403 ms
60,804 KB
testcase_21 AC 549 ms
60,328 KB
testcase_22 AC 408 ms
60,420 KB
testcase_23 AC 127 ms
55,612 KB
testcase_24 AC 592 ms
66,776 KB
testcase_25 AC 528 ms
61,424 KB
testcase_26 AC 303 ms
59,764 KB
testcase_27 AC 126 ms
55,836 KB
evil01.txt AC 672 ms
70,632 KB
evil02.txt AC 684 ms
68,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder.lv1;

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

public class No0182 {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int N = sc.nextInt();
			Map<Integer, Integer> map = new HashMap<>();

			for (int i = 0; i < N; i++) {
				int tmp = sc.nextInt();
				map.computeIfPresent(tmp, (k, v) -> (map.get(tmp) + 1));
				map.putIfAbsent(tmp, 1);
			}
			System.out.println(map.values().stream().filter(i -> i == 1).count());
		}
	}
}
0