結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2016-09-09 00:22:14 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 716 ms / 5,000 ms |
コード長 | 498 bytes |
コンパイル時間 | 6,471 ms |
コンパイル使用メモリ | 75,488 KB |
実行使用メモリ | 54,532 KB |
最終ジャッジ日時 | 2024-12-27 08:34:47 |
合計ジャッジ時間 | 15,947 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
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()); } }