結果
問題 | No.182 新規性の虜 |
ユーザー | take |
提出日時 | 2016-07-10 17:50:19 |
言語 | Java21 (openjdk 21) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,087 bytes |
コンパイル時間 | 2,785 ms |
コンパイル使用メモリ | 75,440 KB |
実行使用メモリ | 66,564 KB |
最終ジャッジ日時 | 2024-04-21 12:03:25 |
合計ジャッジ時間 | 15,824 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 157 ms
46,740 KB |
testcase_01 | AC | 155 ms
41,484 KB |
testcase_02 | AC | 157 ms
41,600 KB |
testcase_03 | AC | 161 ms
41,140 KB |
testcase_04 | AC | 158 ms
41,404 KB |
testcase_05 | AC | 158 ms
41,132 KB |
testcase_06 | AC | 162 ms
41,572 KB |
testcase_07 | AC | 162 ms
41,620 KB |
testcase_08 | AC | 4,890 ms
59,844 KB |
testcase_09 | TLE | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
evil01.txt | -- | - |
evil02.txt | -- | - |
ソースコード
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); // N(配列数) int n = sc.nextInt(); //System.out.println("n=" + n); List<Integer> list = new ArrayList<Integer>(); int index = 0; while((sc.hasNext()) && (index < n + 1)){ int s = sc.nextInt(); list.add(s); index++; } //HashSet<Integer> hashSet = new HashSet<Integer>(); //hashSet.addAll(list); // 重複しない配列 Set<Integer> set = new HashSet<Integer>(); for (Integer s : list) { if (!set.contains(s)) { set.add(s); } } // 新規カウント int c = 0 ; for (Integer x : set) { int cc = Collections.frequency(list, x); if (cc == 1) { c++; } } System.out.println(c); } }