結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー maguroguma
提出日時 2017-08-13 00:54:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 404 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-10-13 06:04:45
合計ジャッジ時間 1,393 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

dp = [False] * (pow(2,15)+1)

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