結果

問題 No.182 新規性の虜
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-25 14:05:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 688 ms / 5,000 ms
コード長 526 bytes
コンパイル時間 3,675 ms
コンパイル使用メモリ 71,676 KB
実行使用メモリ 66,852 KB
最終ジャッジ日時 2023-08-27 15:21:40
合計ジャッジ時間 14,322 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,896 KB
testcase_01 AC 124 ms
55,700 KB
testcase_02 AC 125 ms
55,612 KB
testcase_03 AC 128 ms
55,972 KB
testcase_04 AC 128 ms
53,804 KB
testcase_05 AC 131 ms
55,688 KB
testcase_06 AC 127 ms
55,736 KB
testcase_07 AC 129 ms
56,060 KB
testcase_08 AC 542 ms
63,420 KB
testcase_09 AC 688 ms
65,076 KB
testcase_10 AC 638 ms
64,940 KB
testcase_11 AC 620 ms
62,976 KB
testcase_12 AC 418 ms
60,828 KB
testcase_13 AC 125 ms
56,012 KB
testcase_14 AC 129 ms
55,752 KB
testcase_15 AC 125 ms
55,900 KB
testcase_16 AC 127 ms
56,184 KB
testcase_17 AC 129 ms
55,712 KB
testcase_18 AC 520 ms
60,308 KB
testcase_19 AC 457 ms
60,408 KB
testcase_20 AC 400 ms
60,224 KB
testcase_21 AC 550 ms
62,204 KB
testcase_22 AC 410 ms
60,228 KB
testcase_23 AC 124 ms
56,292 KB
testcase_24 AC 601 ms
66,852 KB
testcase_25 AC 489 ms
60,652 KB
testcase_26 AC 301 ms
60,004 KB
testcase_27 AC 124 ms
56,016 KB
evil01.txt AC 685 ms
68,744 KB
evil02.txt AC 728 ms
67,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
    for(int i = 0; i < N; i++) {
      int a = sc.nextInt();
      if(map.containsKey(a)) {
        map.put(a, map.get(a) + 1);
      } else {
        map.put(a, 1);
      }
    }
    int ans = 0;
    for(int key : map.keySet()) {
      if(map.get(key) == 1) ans++;
    }
    System.out.println(ans);
  }
}
0