結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nanaenanae
提出日時 2017-02-10 12:26:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 827 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 260,192 KB
最終ジャッジ日時 2023-08-27 05:23:43
合計ジャッジ時間 18,937 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
77,532 KB
testcase_01 AC 80 ms
78,128 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2,713 ms
259,664 KB
testcase_08 AC 1,941 ms
260,188 KB
testcase_09 AC 1,380 ms
260,020 KB
testcase_10 AC 1,567 ms
259,532 KB
testcase_11 AC 2,022 ms
259,836 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1,056 ms
259,656 KB
testcase_15 AC 2,089 ms
260,080 KB
testcase_16 WA -
testcase_17 AC 683 ms
260,180 KB
testcase_18 AC 2,305 ms
260,192 KB
testcase_19 AC 419 ms
203,096 KB
権限があれば一括ダウンロードができます

ソースコード

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