結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 WA -
testcase_02 AC 34 ms
10,880 KB
testcase_03 AC 29 ms
10,880 KB
testcase_04 AC 28 ms
10,880 KB
testcase_05 AC 34 ms
10,752 KB
testcase_06 AC 29 ms
10,880 KB
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 AC 41 ms
10,880 KB
testcase_13 AC 31 ms
10,880 KB
testcase_14 AC 30 ms
10,752 KB
testcase_15 WA -
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,15)+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:
        solution(i+1, m)
        solution(i+1, m^A[i])

solution(0, 0)

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

print(pattern)
0