結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー gorugo30gorugo30
提出日時 2021-03-16 23:22:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
MLE  
実行時間 -
コード長 335 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 818,304 KB
最終ジャッジ日時 2024-04-26 06:20:21
合計ジャッジ時間 3,814 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
11,520 KB
testcase_01 AC 121 ms
12,288 KB
testcase_02 AC 236 ms
14,080 KB
testcase_03 AC 209 ms
13,568 KB
testcase_04 AC 85 ms
11,776 KB
testcase_05 AC 251 ms
14,464 KB
testcase_06 AC 138 ms
12,544 KB
testcase_07 MLE -
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 #

N = int(input())
dp = [[False] * (2 ** 15) for i in range(N)]
A = list(map(int, input().split()))
dp[0][0] = True
dp[0][A[0]] = True
for i in range(1, N):
    for j in range(2 ** 15):
        dp[i][j] |= dp[i - 1][j]
        dp[i][j ^ A[i]] |= dp[i - 1][j]
ans = 0
for i in range(2 ** 15):
    if dp[-1][i]:
        ans += 1
print(ans)
0