結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー magurogumamaguroguma
提出日時 2017-08-13 01:31:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 398 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 12,160 KB
最終ジャッジ日時 2024-04-21 07:20:15
合計ジャッジ時間 1,689 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
11,392 KB
testcase_01 AC 37 ms
11,264 KB
testcase_02 AC 41 ms
11,392 KB
testcase_03 AC 38 ms
11,392 KB
testcase_04 AC 39 ms
11,264 KB
testcase_05 AC 45 ms
11,392 KB
testcase_06 AC 39 ms
11,392 KB
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 51 ms
11,264 KB
testcase_13 AC 38 ms
11,392 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 39 ms
11,264 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 AC 46 ms
11,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N = int(input())
A = list(map(int, input().split()))

dp = [False] * 100000

def solution(i, m):
    if not dp[m]:
        if i<N-1:
            solution(i+1, m)
        dp[m] = True
    if not dp[m^A[i]]:
        if i<N-1:
            solution(i+1, m^A[i])
        dp[m^A[i]] = True

solution(0, 0)

pattern = 0
for b in dp:
    if b:
        pattern += 1

print(pattern)
0