結果

問題 No.182 新規性の虜
ユーザー ffmm00
提出日時 2015-06-04 03:35:05
言語 Java
(openjdk 23)
結果
AC  
実行時間 934 ms / 5,000 ms
コード長 610 bytes
コンパイル時間 4,439 ms
コンパイル使用メモリ 75,284 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2024-12-26 19:16:17
合計ジャッジ時間 19,050 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class N182 {

	public static void main(String[] args) {
		Scanner sca = new Scanner(System.in);
		Map<Integer, Integer> vt = new HashMap<Integer, Integer>();

		int n = sca.nextInt();
		int[] a = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = sca.nextInt();
			if (vt.containsKey(a[i]))
				vt.put(a[i], vt.get(a[i]) + 1);
			else
				vt.put(a[i], 1);
		}

		int C = 0;

		for (Map.Entry<Integer, Integer> voter : vt.entrySet()) {
			int S = voter.getValue();
			if (S == 1)
				C++;
		}

		System.out.println(C);

	}

}
0