結果
問題 | No.182 新規性の虜 |
ユーザー | a3636tako |
提出日時 | 2016-08-25 15:45:06 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 221 ms / 5,000 ms |
コード長 | 2,119 bytes |
コンパイル時間 | 2,174 ms |
コンパイル使用メモリ | 75,220 KB |
実行使用メモリ | 60,940 KB |
最終ジャッジ日時 | 2023-08-27 14:01:24 |
合計ジャッジ時間 | 6,968 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
48,968 KB |
testcase_01 | AC | 45 ms
49,324 KB |
testcase_02 | AC | 43 ms
48,892 KB |
testcase_03 | AC | 44 ms
49,312 KB |
testcase_04 | AC | 46 ms
48,896 KB |
testcase_05 | AC | 46 ms
49,056 KB |
testcase_06 | AC | 45 ms
49,080 KB |
testcase_07 | AC | 45 ms
49,352 KB |
testcase_08 | AC | 192 ms
58,476 KB |
testcase_09 | AC | 221 ms
58,228 KB |
testcase_10 | AC | 206 ms
56,212 KB |
testcase_11 | AC | 198 ms
58,140 KB |
testcase_12 | AC | 140 ms
56,020 KB |
testcase_13 | AC | 44 ms
49,104 KB |
testcase_14 | AC | 44 ms
48,892 KB |
testcase_15 | AC | 44 ms
49,004 KB |
testcase_16 | AC | 43 ms
49,080 KB |
testcase_17 | AC | 44 ms
49,108 KB |
testcase_18 | AC | 158 ms
55,660 KB |
testcase_19 | AC | 148 ms
55,672 KB |
testcase_20 | AC | 128 ms
55,948 KB |
testcase_21 | AC | 158 ms
55,900 KB |
testcase_22 | AC | 136 ms
55,740 KB |
testcase_23 | AC | 43 ms
49,244 KB |
testcase_24 | AC | 190 ms
60,940 KB |
testcase_25 | AC | 122 ms
54,312 KB |
testcase_26 | AC | 109 ms
55,272 KB |
testcase_27 | AC | 44 ms
48,996 KB |
evil01.txt | AC | 212 ms
60,076 KB |
evil02.txt | AC | 210 ms
60,428 KB |
ソースコード
import java.io.*; import java.util.*; public class Main{ public void solve(){ int N = nextInt(); HashMap<Integer, Integer> set = new HashMap<>(); for(int i = 0; i < N; i++){ int k = nextInt(); Integer val = set.get(k); if(val == null){ val = 1; }else{ val = 2; } set.put(k, val); } int ans = 0; for(int v : set.values()){ if(v == 1){ ans++; } } out.println(ans); } private static PrintWriter out; public static void main(String[] args){ out = new PrintWriter(System.out); new Main().solve(); out.flush(); } public static int nextInt(){ int num = 0; String str = next(); boolean minus = false; int i = 0; if(str.charAt(0) == '-'){ minus = true; i++; } int len = str.length(); for(;i < len; i++){ char c = str.charAt(i); if(!('0' <= c && c <= '9')) throw new RuntimeException(); num = num * 10 + (c - '0'); } return minus ? -num : num; } public static long nextLong(){ long num = 0; String str = next(); boolean minus = false; int i = 0; if(str.charAt(0) == '-'){ minus = true; i++; } int len = str.length(); for(;i < len; i++){ char c = str.charAt(i); if(!('0' <= c && c <= '9')) throw new RuntimeException(); num = num * 10l + (c - '0'); } return minus ? -num : num; } public static String next(){ int c; while(!isAlNum(c = read())){} StringBuilder build = new StringBuilder(); build.append((char)c); while(isAlNum(c = read())){ build.append((char)c); } return build.toString(); } private static byte[] inputBuffer = new byte[1024]; private static int bufferLength = 0; private static int bufferIndex = 0; private static int read(){ if(bufferLength < 0) throw new RuntimeException(); if(bufferIndex >= bufferLength){ try{ bufferLength = System.in.read(inputBuffer); bufferIndex = 0; }catch(IOException e){ throw new RuntimeException(e); } if(bufferLength <= 0) return (bufferLength = -1); } return inputBuffer[bufferIndex++]; } private static boolean isAlNum(int c){ return '!' <= c && c <= '~'; } }