結果

問題 No.182 新規性の虜
ユーザー rf141rf141
提出日時 2015-08-09 23:35:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 605 ms / 5,000 ms
コード長 651 bytes
コンパイル時間 3,081 ms
コンパイル使用メモリ 72,252 KB
実行使用メモリ 64,948 KB
最終ジャッジ日時 2023-08-27 07:30:27
合計ジャッジ時間 13,476 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
55,964 KB
testcase_01 AC 116 ms
55,768 KB
testcase_02 AC 116 ms
56,320 KB
testcase_03 AC 118 ms
56,160 KB
testcase_04 AC 119 ms
56,220 KB
testcase_05 AC 122 ms
55,564 KB
testcase_06 AC 118 ms
56,212 KB
testcase_07 AC 116 ms
54,124 KB
testcase_08 AC 483 ms
63,272 KB
testcase_09 AC 605 ms
64,792 KB
testcase_10 AC 562 ms
64,948 KB
testcase_11 AC 541 ms
62,792 KB
testcase_12 AC 400 ms
62,484 KB
testcase_13 AC 118 ms
55,848 KB
testcase_14 AC 122 ms
55,844 KB
testcase_15 AC 114 ms
55,580 KB
testcase_16 AC 116 ms
56,164 KB
testcase_17 AC 125 ms
55,864 KB
testcase_18 AC 501 ms
60,316 KB
testcase_19 AC 433 ms
60,304 KB
testcase_20 AC 368 ms
60,356 KB
testcase_21 AC 464 ms
60,160 KB
testcase_22 AC 387 ms
60,060 KB
testcase_23 AC 118 ms
56,068 KB
testcase_24 AC 556 ms
64,884 KB
testcase_25 AC 452 ms
60,796 KB
testcase_26 AC 263 ms
59,828 KB
testcase_27 AC 115 ms
56,080 KB
evil01.txt AC 611 ms
67,632 KB
evil02.txt AC 600 ms
64,196 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)){
				if(hash.get(now)>2)continue;
				hash.put(now,hash.get(now)+1);
			}
		}
		int count=0;
		for(int key : hash.values()){
			if(key!=1)continue;
			count++;
		}
		return count;
	}
}
0