結果

問題 No.182 新規性の虜
ユーザー dazydazy
提出日時 2017-02-23 14:34:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 606 ms / 5,000 ms
コード長 599 bytes
コンパイル時間 5,149 ms
コンパイル使用メモリ 72,596 KB
実行使用メモリ 65,196 KB
最終ジャッジ日時 2023-08-27 15:14:59
合計ジャッジ時間 15,847 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,040 KB
testcase_01 AC 108 ms
56,012 KB
testcase_02 AC 113 ms
55,780 KB
testcase_03 AC 115 ms
55,832 KB
testcase_04 AC 113 ms
55,872 KB
testcase_05 AC 116 ms
56,156 KB
testcase_06 AC 116 ms
55,980 KB
testcase_07 AC 119 ms
56,032 KB
testcase_08 AC 473 ms
62,920 KB
testcase_09 AC 606 ms
65,196 KB
testcase_10 AC 546 ms
65,036 KB
testcase_11 AC 515 ms
62,820 KB
testcase_12 AC 366 ms
60,824 KB
testcase_13 AC 113 ms
55,800 KB
testcase_14 AC 114 ms
55,972 KB
testcase_15 AC 109 ms
56,200 KB
testcase_16 AC 112 ms
55,796 KB
testcase_17 AC 117 ms
55,880 KB
testcase_18 AC 451 ms
60,904 KB
testcase_19 AC 386 ms
60,980 KB
testcase_20 AC 325 ms
60,336 KB
testcase_21 AC 448 ms
60,400 KB
testcase_22 AC 357 ms
60,224 KB
testcase_23 AC 113 ms
55,912 KB
testcase_24 AC 500 ms
64,876 KB
testcase_25 AC 442 ms
60,580 KB
testcase_26 AC 272 ms
60,396 KB
testcase_27 AC 113 ms
54,328 KB
evil01.txt AC 543 ms
67,072 KB
evil02.txt AC 645 ms
67,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Run {
    public static void main (String arg[]) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int ans = N;
        int A;
        HashMap<Integer, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            A = scan.nextInt();
            if (!M.containsKey(A)) M.put(A, 1);
            else {
                if (M.get(A)==1) {
                    ans-=2;
                    M.put(A, 2);
                }
                else ans--;
            }
        }
        System.out.println(ans);
    }
}
0