結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー | fjafjafja |
提出日時 | 2017-10-03 21:54:22 |
言語 | Java21 (openjdk 21) |
結果 |
RE
|
実行時間 | - |
コード長 | 518 bytes |
コンパイル時間 | 3,663 ms |
コンパイル使用メモリ | 72,720 KB |
実行使用メモリ | 62,756 KB |
最終ジャッジ日時 | 2023-08-10 05:36:20 |
合計ジャッジ時間 | 10,326 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 124 ms
56,120 KB |
testcase_01 | AC | 125 ms
55,560 KB |
testcase_02 | AC | 130 ms
56,016 KB |
testcase_03 | AC | 125 ms
55,920 KB |
testcase_04 | AC | 121 ms
55,808 KB |
testcase_05 | AC | 131 ms
55,904 KB |
testcase_06 | AC | 124 ms
55,924 KB |
testcase_07 | RE | - |
testcase_08 | AC | 568 ms
60,460 KB |
testcase_09 | AC | 477 ms
58,880 KB |
testcase_10 | AC | 497 ms
60,260 KB |
testcase_11 | AC | 571 ms
60,488 KB |
testcase_12 | RE | - |
testcase_13 | AC | 122 ms
55,528 KB |
testcase_14 | AC | 211 ms
59,168 KB |
testcase_15 | AC | 621 ms
62,756 KB |
testcase_16 | AC | 124 ms
55,840 KB |
testcase_17 | AC | 282 ms
59,128 KB |
testcase_18 | RE | - |
testcase_19 | AC | 245 ms
56,840 KB |
ソースコード
import java.util.ArrayList; import java.util.Scanner; public class N183 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); ArrayList<Integer> al=new ArrayList<Integer>(); al.add(0); int[] h=new int[16384+1]; h[0]=1; for(int i=0;i<n;i++){ int a=sc.nextInt(); int buf=al.size(); for(int j=0;j<buf;j++){ int newint=al.get(j)^a; if(h[newint]==0){ al.add(newint); h[newint]++; } } } System.out.println(al.size()); } }