結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー YamaKasaYamaKasa
提出日時 2018-07-27 19:34:38
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 577 bytes
コンパイル時間 2,057 ms
コンパイル使用メモリ 71,716 KB
実行使用メモリ 60,188 KB
最終ジャッジ日時 2023-09-17 19:11:11
合計ジャッジ時間 7,921 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,724 KB
testcase_01 AC 127 ms
55,744 KB
testcase_02 AC 135 ms
55,960 KB
testcase_03 AC 132 ms
55,648 KB
testcase_04 AC 127 ms
56,128 KB
testcase_05 AC 132 ms
55,532 KB
testcase_06 AC 133 ms
55,684 KB
testcase_07 RE -
testcase_08 AC 367 ms
60,188 KB
testcase_09 AC 350 ms
59,764 KB
testcase_10 AC 353 ms
60,080 KB
testcase_11 AC 379 ms
60,096 KB
testcase_12 RE -
testcase_13 AC 125 ms
55,860 KB
testcase_14 AC 340 ms
60,020 KB
testcase_15 AC 387 ms
60,072 KB
testcase_16 AC 132 ms
56,056 KB
testcase_17 AC 243 ms
56,672 KB
testcase_18 RE -
testcase_19 AC 213 ms
57,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int max = (int)Math.pow(2, 14);
		int []dp = new int[max];
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int []A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = scan.nextInt();
			dp[A[i]] = 1;
		}
		scan.close();
		for(int i = 0; i < N; i++) {
			for(int j = 0; j < max; j++) {
				if(dp[j] != 0) {
					dp[A[i] ^ j] = 1;
				}
			}
		}
		int cnt = 0;
		for(int i = 0; i< max; i++) {
			if(dp[i] != 0) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}
0