結果

問題 No.182 新規性の虜
ユーザー rf141rf141
提出日時 2015-08-09 22:13:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 643 ms / 5,000 ms
コード長 618 bytes
コンパイル時間 5,223 ms
コンパイル使用メモリ 73,616 KB
実行使用メモリ 65,096 KB
最終ジャッジ日時 2023-08-27 07:30:04
合計ジャッジ時間 15,084 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,580 KB
testcase_01 AC 119 ms
55,716 KB
testcase_02 AC 115 ms
55,392 KB
testcase_03 AC 117 ms
55,456 KB
testcase_04 AC 120 ms
56,304 KB
testcase_05 AC 124 ms
55,764 KB
testcase_06 AC 123 ms
56,224 KB
testcase_07 AC 124 ms
55,976 KB
testcase_08 AC 493 ms
62,580 KB
testcase_09 AC 643 ms
65,096 KB
testcase_10 AC 582 ms
65,044 KB
testcase_11 AC 549 ms
63,084 KB
testcase_12 AC 378 ms
61,912 KB
testcase_13 AC 120 ms
55,992 KB
testcase_14 AC 120 ms
55,720 KB
testcase_15 AC 115 ms
55,856 KB
testcase_16 AC 117 ms
55,860 KB
testcase_17 AC 136 ms
55,772 KB
testcase_18 AC 492 ms
60,844 KB
testcase_19 AC 431 ms
60,560 KB
testcase_20 AC 379 ms
60,192 KB
testcase_21 AC 535 ms
60,592 KB
testcase_22 AC 397 ms
60,512 KB
testcase_23 AC 119 ms
55,720 KB
testcase_24 AC 557 ms
64,560 KB
testcase_25 AC 474 ms
60,812 KB
testcase_26 AC 287 ms
60,328 KB
testcase_27 AC 119 ms
56,108 KB
evil01.txt AC 623 ms
67,036 KB
evil02.txt AC 621 ms
67,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Novelty{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		System.out.println(counter(n,scan));
	}
	public static int counter(int n, Scanner scan){
		HashMap<Integer,Integer> hash = new HashMap<Integer,Integer>();
		for(int i = 0; i < n; i++){
			int now = scan.nextInt();
			if(!hash.containsKey(now)){
				hash.put(now,1);
				continue;
			}
			if(hash.containsKey(now)){
				hash.put(now,hash.get(now)+1);
			}
		}
		int count=0;
		for(int key : hash.values()){
			if(key!=1)continue;
			count++;
		}
		return count;
	}
}
0