結果

問題 No.182 新規性の虜
ユーザー TatsuDXTatsuDX
提出日時 2016-09-09 00:22:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 661 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 5,431 ms
コンパイル使用メモリ 72,640 KB
実行使用メモリ 64,668 KB
最終ジャッジ日時 2023-08-27 12:54:50
合計ジャッジ時間 14,269 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,968 KB
testcase_01 AC 126 ms
55,508 KB
testcase_02 AC 125 ms
55,540 KB
testcase_03 AC 128 ms
55,700 KB
testcase_04 AC 128 ms
55,596 KB
testcase_05 AC 129 ms
55,688 KB
testcase_06 AC 129 ms
56,108 KB
testcase_07 AC 132 ms
55,908 KB
testcase_08 AC 517 ms
62,796 KB
testcase_09 AC 661 ms
64,668 KB
testcase_10 AC 590 ms
64,632 KB
testcase_11 AC 574 ms
62,800 KB
testcase_12 AC 407 ms
60,952 KB
testcase_13 AC 123 ms
55,868 KB
testcase_14 AC 126 ms
56,132 KB
testcase_15 AC 122 ms
56,320 KB
testcase_16 AC 125 ms
55,956 KB
testcase_17 AC 126 ms
55,828 KB
testcase_18 AC 538 ms
60,172 KB
testcase_19 AC 427 ms
60,168 KB
testcase_20 AC 384 ms
60,560 KB
testcase_21 AC 537 ms
60,448 KB
testcase_22 AC 388 ms
60,188 KB
testcase_23 AC 121 ms
55,584 KB
testcase_24 AC 553 ms
64,552 KB
testcase_25 AC 473 ms
60,504 KB
testcase_26 AC 276 ms
60,360 KB
testcase_27 AC 125 ms
55,700 KB
evil01.txt AC 656 ms
66,748 KB
evil02.txt AC 654 ms
66,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		Set<Integer> set1 = new HashSet<Integer>();
		Set<Integer> set2 = new HashSet<Integer>();
		int n = sc.nextInt(), tmp, cnt = 0;
		for(int i = 0; i < n; i++){
			tmp = sc.nextInt();
			if(!set1.contains(tmp)){
				set1.add(tmp);
			} else {
				set2.add(tmp);
			}
		}
		System.out.println(set1.size()-set2.size());
	}
}
0