結果

問題 No.182 新規性の虜
ユーザー yuki2006yuki2006
提出日時 2016-07-10 18:01:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 687 ms / 5,000 ms
コード長 566 bytes
コンパイル時間 2,813 ms
コンパイル使用メモリ 73,192 KB
実行使用メモリ 66,856 KB
最終ジャッジ日時 2023-08-27 12:03:49
合計ジャッジ時間 14,379 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,368 KB
testcase_01 AC 128 ms
55,816 KB
testcase_02 AC 129 ms
55,896 KB
testcase_03 AC 131 ms
55,772 KB
testcase_04 AC 130 ms
55,816 KB
testcase_05 AC 134 ms
55,880 KB
testcase_06 AC 130 ms
55,820 KB
testcase_07 AC 132 ms
55,808 KB
testcase_08 AC 538 ms
62,592 KB
testcase_09 AC 687 ms
64,928 KB
testcase_10 AC 625 ms
64,972 KB
testcase_11 AC 586 ms
62,876 KB
testcase_12 AC 418 ms
60,736 KB
testcase_13 AC 130 ms
55,696 KB
testcase_14 AC 133 ms
55,976 KB
testcase_15 AC 128 ms
55,548 KB
testcase_16 AC 131 ms
55,656 KB
testcase_17 AC 137 ms
55,924 KB
testcase_18 AC 587 ms
60,588 KB
testcase_19 AC 468 ms
60,676 KB
testcase_20 AC 396 ms
60,916 KB
testcase_21 AC 583 ms
60,924 KB
testcase_22 AC 427 ms
60,728 KB
testcase_23 AC 125 ms
55,964 KB
testcase_24 AC 609 ms
66,856 KB
testcase_25 AC 490 ms
60,776 KB
testcase_26 AC 286 ms
59,248 KB
testcase_27 AC 127 ms
55,668 KB
evil01.txt AC 652 ms
66,888 KB
evil02.txt AC 678 ms
67,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        HashSet<Integer> nums = new HashSet<>();
        HashSet<Integer> doubles = new HashSet<>();
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        for (int i = 0; i < N; i++) {
            int v = scanner.nextInt();
            if (nums.contains(v)) {
                doubles.add(v);
            }
            nums.add(v);
        }
        System.out.println(nums.size() - doubles.size());


    }
}
0