結果
問題 | No.182 新規性の虜 |
ユーザー |
|
提出日時 | 2017-04-21 17:49:17 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 765 ms / 5,000 ms |
コード長 | 643 bytes |
コンパイル時間 | 2,551 ms |
コンパイル使用メモリ | 88,336 KB |
実行使用メモリ | 54,276 KB |
最終ジャッジ日時 | 2024-12-27 15:20:45 |
合計ジャッジ時間 | 13,893 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] argse) { Scanner sc = new Scanner(System.in); int N = Integer.parseInt(sc.next()); Map<Long, Integer> map = new HashMap<>(); for (int i = 0; i < N; i++) { long X = Long.parseLong(sc.next()); if (!map.containsKey(X)) map.put(X, 0); map.put(X, map.get(X) + 1); } final int[] sum = {0}; map.forEach((aLong, integer) -> { if (integer == 1) sum[0]++; }); System.out.println(sum[0]); } }