結果
問題 | No.182 新規性の虜 |
ユーザー | YukimotoPG |
提出日時 | 2019-03-01 14:10:36 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 175 ms / 5,000 ms |
コード長 | 2,125 bytes |
コンパイル時間 | 2,331 ms |
コンパイル使用メモリ | 78,624 KB |
実行使用メモリ | 48,452 KB |
最終ジャッジ日時 | 2024-06-23 12:03:08 |
合計ジャッジ時間 | 6,205 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
36,820 KB |
testcase_01 | AC | 49 ms
36,956 KB |
testcase_02 | AC | 48 ms
36,660 KB |
testcase_03 | AC | 48 ms
36,668 KB |
testcase_04 | AC | 47 ms
36,724 KB |
testcase_05 | AC | 48 ms
36,920 KB |
testcase_06 | AC | 52 ms
36,444 KB |
testcase_07 | AC | 49 ms
36,704 KB |
testcase_08 | AC | 159 ms
45,480 KB |
testcase_09 | AC | 175 ms
45,716 KB |
testcase_10 | AC | 162 ms
45,292 KB |
testcase_11 | AC | 169 ms
45,364 KB |
testcase_12 | AC | 117 ms
41,032 KB |
testcase_13 | AC | 47 ms
36,444 KB |
testcase_14 | AC | 49 ms
36,696 KB |
testcase_15 | AC | 50 ms
36,864 KB |
testcase_16 | AC | 48 ms
36,864 KB |
testcase_17 | AC | 51 ms
36,688 KB |
testcase_18 | AC | 133 ms
41,688 KB |
testcase_19 | AC | 123 ms
40,740 KB |
testcase_20 | AC | 103 ms
40,116 KB |
testcase_21 | AC | 134 ms
41,884 KB |
testcase_22 | AC | 105 ms
40,232 KB |
testcase_23 | AC | 50 ms
36,548 KB |
testcase_24 | AC | 157 ms
48,452 KB |
testcase_25 | AC | 103 ms
40,028 KB |
testcase_26 | AC | 94 ms
38,608 KB |
testcase_27 | AC | 54 ms
36,588 KB |
evil01.txt | AC | 186 ms
48,456 KB |
evil02.txt | AC | 180 ms
48,072 KB |
ソースコード
import java.util.*; import java.io.*; class Main { public static void main(String[] args) { int n = nextInt(); HashMap<Integer, Integer> map = new HashMap<>(); for (int i=0; i<n; i++) { int temp = nextInt(); map.put(temp, map.getOrDefault(temp,0)+1); } int ans = 0; for (Map.Entry<Integer, Integer> e : map.entrySet()) { if (e.getValue() == 1) ans++; } System.out.println(ans); } // <Fast Scanner> START ------------------------------------------------- static InputStream in = System.in; static byte[] buffer = new byte[1024]; static int length = 0, p = 0; public static boolean hasNextByte () { if (p < length) return true; else { p = 0; try {length = in.read(buffer);} catch (Exception e) {e.printStackTrace();} if (length == 0) return false; } return true; } public static int readByte () { if (hasNextByte() == true) return buffer[p++]; return -1; } public static boolean isPrintable (int n) {return 33<=n&&n<=126;} public static void skip () { while (hasNextByte() && !isPrintable(buffer[p])) p++; } public static boolean hasNext () {skip(); return hasNextByte();} public static String next () { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int temp = readByte(); while (isPrintable(temp)) { sb.appendCodePoint(temp); temp = readByte(); } return sb.toString(); } public static int nextInt () {return Math.toIntExact(nextLong());} public static int[] nextInts (int n) { int[] ar = new int[n]; for (int i=0; i<n; i++) ar[i] = nextInt(); return ar; } public static long nextLong () { if (!hasNext()) throw new NoSuchElementException(); boolean minus = false; int temp = readByte(); if (temp == '-') { minus = true; temp = readByte(); } if (temp<'0' || '9'<temp) throw new NumberFormatException(); long n = 0; while (isPrintable(temp)) { if ('0'<=temp && temp<='9') { n *= 10; n += temp - '0'; } temp = readByte(); } return minus? -n : n; } // <Fast Scanner> END ---------------------------------------------------------- }