結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー terrafarmterrafarm
提出日時 2020-12-14 08:25:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 668 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,864 KB
実行使用メモリ 12,280 KB
最終ジャッジ日時 2023-10-20 04:46:57
合計ジャッジ時間 7,425 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
12,280 KB
testcase_01 AC 63 ms
12,224 KB
testcase_02 AC 69 ms
12,224 KB
testcase_03 AC 66 ms
12,224 KB
testcase_04 AC 57 ms
12,224 KB
testcase_05 AC 69 ms
12,224 KB
testcase_06 AC 62 ms
12,224 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import logging
import sys
from inspect import currentframe

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline

logging.basicConfig(level=logging.DEBUG)


def dbg(*args):
    id2names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}
    logging.debug(
        ", ".join(id2names.get(id(arg), "???") + " = " + repr(arg) for arg in args)
    )


def main():

    MAX = 1 << 15
    n = int(input())
    a = list(map(int, input().split()))
    dp = [False] * MAX
    dp[0] = True
    for i in range(n):
        for j in range(MAX):
            if dp[j]:
                dp[j ^ a[i]] = True

    print(sum(dp))


if __name__ == "__main__":
    main()
0