結果

問題 No.182 新規性の虜
ユーザー AoiroFukurou
提出日時 2016-07-10 15:30:13
言語 Java
(openjdk 23)
結果
AC  
実行時間 968 ms / 5,000 ms
コード長 568 bytes
コンパイル時間 7,400 ms
コンパイル使用メモリ 74,928 KB
実行使用メモリ 53,560 KB
最終ジャッジ日時 2024-12-27 05:58:10
合計ジャッジ時間 23,058 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

package b20160710;

import java.util.HashMap;
import java.util.Scanner;

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