結果

問題 No.182 新規性の虜
ユーザー mobius_bkstmobius_bkst
提出日時 2015-04-16 23:59:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 385 ms / 5,000 ms
コード長 1,192 bytes
コンパイル時間 2,402 ms
コンパイル使用メモリ 87,972 KB
実行使用メモリ 65,904 KB
最終ジャッジ日時 2023-08-27 07:08:44
合計ジャッジ時間 8,766 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,416 KB
testcase_01 AC 46 ms
49,208 KB
testcase_02 AC 46 ms
49,912 KB
testcase_03 AC 45 ms
49,380 KB
testcase_04 AC 46 ms
49,704 KB
testcase_05 AC 45 ms
49,592 KB
testcase_06 AC 45 ms
49,240 KB
testcase_07 AC 45 ms
49,308 KB
testcase_08 AC 304 ms
60,372 KB
testcase_09 AC 385 ms
65,284 KB
testcase_10 AC 354 ms
62,792 KB
testcase_11 AC 337 ms
63,208 KB
testcase_12 AC 220 ms
58,224 KB
testcase_13 AC 44 ms
49,520 KB
testcase_14 AC 45 ms
49,380 KB
testcase_15 AC 44 ms
49,460 KB
testcase_16 AC 45 ms
49,360 KB
testcase_17 AC 45 ms
49,420 KB
testcase_18 AC 256 ms
60,464 KB
testcase_19 AC 215 ms
57,732 KB
testcase_20 AC 178 ms
56,908 KB
testcase_21 AC 279 ms
60,560 KB
testcase_22 AC 213 ms
56,424 KB
testcase_23 AC 45 ms
49,256 KB
testcase_24 AC 341 ms
65,904 KB
testcase_25 AC 179 ms
58,528 KB
testcase_26 AC 144 ms
55,196 KB
testcase_27 AC 45 ms
49,532 KB
evil01.txt AC 351 ms
66,252 KB
evil02.txt AC 330 ms
66,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Set;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(
                    System.in));
            int N = Integer.parseInt(br.readLine());

            TreeMap<Integer, Boolean> map = new TreeMap<Integer, Boolean>();

            String[] Aarray = br.readLine().split(" ");
            int A = 0;
            for (int i = 0; i < N; i++) {
                A = Integer.parseInt(Aarray[i]);
                boolean bool = map.containsKey(A);
                if (bool) {
                    map.put(A, true);
                } else {
                    map.put(A, false);
                }
            }

            Set<Integer> aSet = map.keySet();
            int ans = 0;
            for (Integer a : aSet) {
                if (!map.get(a)) {
                    ans++;
                }
            }
            System.out.println(ans);
        } catch (Exception e) {
            System.err.println("Error:" + e.getMessage());
        }
    }

}
0