結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー fjafjafjafjafjafja
提出日時 2017-10-03 21:54:22
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 518 bytes
コンパイル時間 3,589 ms
コンパイル使用メモリ 75,692 KB
実行使用メモリ 60,544 KB
最終ジャッジ日時 2024-04-27 22:54:23
合計ジャッジ時間 8,916 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
41,084 KB
testcase_01 AC 107 ms
41,240 KB
testcase_02 AC 105 ms
40,608 KB
testcase_03 AC 108 ms
41,748 KB
testcase_04 AC 100 ms
40,268 KB
testcase_05 AC 111 ms
41,764 KB
testcase_06 AC 108 ms
41,048 KB
testcase_07 RE -
testcase_08 AC 507 ms
48,148 KB
testcase_09 AC 408 ms
47,820 KB
testcase_10 AC 465 ms
47,996 KB
testcase_11 AC 510 ms
48,116 KB
testcase_12 RE -
testcase_13 AC 105 ms
41,132 KB
testcase_14 AC 183 ms
45,896 KB
testcase_15 AC 555 ms
47,776 KB
testcase_16 AC 103 ms
40,452 KB
testcase_17 AC 268 ms
43,696 KB
testcase_18 RE -
testcase_19 AC 216 ms
43,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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());
	}
}
0