結果
問題 | No.182 新規性の虜 |
ユーザー | a3636tako |
提出日時 | 2016-08-25 15:45:06 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 192 ms / 5,000 ms |
コード長 | 2,119 bytes |
コンパイル時間 | 2,274 ms |
コンパイル使用メモリ | 78,452 KB |
実行使用メモリ | 49,672 KB |
最終ジャッジ日時 | 2024-06-08 09:37:08 |
合計ジャッジ時間 | 6,288 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 50 ms
36,920 KB |
testcase_01 | AC | 49 ms
36,620 KB |
testcase_02 | AC | 48 ms
36,164 KB |
testcase_03 | AC | 51 ms
36,852 KB |
testcase_04 | AC | 50 ms
36,372 KB |
testcase_05 | AC | 49 ms
36,288 KB |
testcase_06 | AC | 48 ms
36,536 KB |
testcase_07 | AC | 48 ms
36,824 KB |
testcase_08 | AC | 176 ms
47,148 KB |
testcase_09 | AC | 192 ms
48,772 KB |
testcase_10 | AC | 188 ms
47,292 KB |
testcase_11 | AC | 173 ms
46,988 KB |
testcase_12 | AC | 144 ms
45,124 KB |
testcase_13 | AC | 48 ms
36,292 KB |
testcase_14 | AC | 48 ms
36,416 KB |
testcase_15 | AC | 48 ms
36,852 KB |
testcase_16 | AC | 48 ms
36,644 KB |
testcase_17 | AC | 46 ms
36,404 KB |
testcase_18 | AC | 150 ms
44,948 KB |
testcase_19 | AC | 147 ms
44,236 KB |
testcase_20 | AC | 128 ms
43,956 KB |
testcase_21 | AC | 160 ms
44,892 KB |
testcase_22 | AC | 130 ms
44,164 KB |
testcase_23 | AC | 49 ms
36,716 KB |
testcase_24 | AC | 179 ms
49,672 KB |
testcase_25 | AC | 102 ms
40,888 KB |
testcase_26 | AC | 117 ms
41,940 KB |
testcase_27 | AC | 47 ms
36,724 KB |
evil01.txt | AC | 209 ms
50,020 KB |
evil02.txt | AC | 206 ms
50,028 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 <= '~'; } }