結果
問題 | No.182 新規性の虜 |
ユーザー |
![]() |
提出日時 | 2020-05-13 10:42:31 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 742 ms / 5,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 2,075 ms |
コンパイル使用メモリ | 75,036 KB |
実行使用メモリ | 52,912 KB |
最終ジャッジ日時 | 2024-09-14 15:28:39 |
合計ジャッジ時間 | 13,969 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashSet<Integer> singles = new HashSet<>(); HashSet<Integer> doubles = new HashSet<>(); for (int i = 0; i < n; i++) { int x = sc.nextInt(); if (singles.contains(x)) { doubles.add(x); } else { singles.add(x); } } System.out.println(singles.size() - doubles.size()); } }