結果

問題 No.182 新規性の虜
ユーザー kenji_shioya
提出日時 2016-06-20 22:23:11
言語 Java
(openjdk 23)
結果
AC  
実行時間 736 ms / 5,000 ms
コード長 563 bytes
コンパイル時間 7,730 ms
コンパイル使用メモリ 83,820 KB
実行使用メモリ 53,396 KB
最終ジャッジ日時 2024-12-27 05:06:35
合計ジャッジ時間 15,400 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise102{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();
    for(int i = 0; i < n; i++){
      int x = sc.nextInt();
      if(map.containsKey(x)){
        map.put(x, false);
      }else{
        map.put(x, true);
      }
    }
    int count = 0;
    for(Map.Entry<Integer, Boolean> e:map.entrySet()){
      if(e.getValue()){
        count++;
      }
    }
    System.out.println(count);
  }
}
0