結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nanae
提出日時 2017-02-10 12:26:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 259,968 KB
最終ジャッジ日時 2024-12-26 14:37:34
合計ジャッジ時間 19,214 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 10 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N = int(input())
    As = [int(i) for i in input().split()]
    dp = [[False]*(2**15) for i in range(2)]
    dp[0][0] = True

    for a in As:
        for j in range(2**15):
            if dp[0][j] == True:
                dp[1][a ^ j] = True
        dp[0] = dp[1][:]

    ans = sum(i for i in dp[1][:])

    print(ans)

if __name__ == '__main__':
    solve()
0