結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー magurogumamaguroguma
提出日時 2017-08-13 00:43:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,648 KB
最終ジャッジ日時 2024-04-21 07:19:42
合計ジャッジ時間 1,463 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

N = int(input())
A = list(map(int, input().split()))
#B = []
#for a in A:
#    B.append(format(a, '015b'))

#X = 0
dp = [False] * (pow(2,14)+1)
dp[0] = True

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

solution(0, 0)

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

print(pattern)
0